- 帖子
- 288
- 积分
- 415
- 技术
- 1
- 捐助
- 0
- 注册时间
- 2011-1-20
|
本帖最后由 locoman 于 2023-3-17 16:22 编辑
试试把注销换成这样
idwma 发表于 2023-3-16 16:57
谢谢您了!
实测:我手工在注册表中修改了鼠标指针后,再运行您这个powershell后,就立即生效了!!
再请教:
1. 您这段powershell代码只能对修改鼠标指针立即生效有作用?还是可以对所有注册表修改都能立即生效吗?
2. 您这段powershell代码与下面这两句有啥区别?使用哪个更好呢??
taskkill /f /im explorer.exe
start explorer.exe
3. 据此,将4楼的代码整合如下吗?
set "curfile=C:\zhuxing.cur"
cd /d "%~dp0"
if not exist recover.reg (reg export "HKCU\Control Panel\Cursors" recover.reg)
reg query "HKCU\Control Panel\Cursors" /v Arrow | findstr /c:"%curfile%" && goto re
reg add "HKCU\Control Panel\Cursors" /v Arrow /t REG_EXPAND_SZ /d "%curfile%" /f
powershell "Add-Type 'using System.Runtime.InteropServices;public static class test{[DllImport(\"user32.dll\", EntryPoint = \"SystemParametersInfo\")]public static extern bool SystemParametersInfo(uint uiAction, uint uiParam, uint pvParam, uint fWinIni);}';[test]::SystemParametersInfo(0x0057,0,$null,0)"
exit
:re
reg import recover.reg
powershell "Add-Type 'using System.Runtime.InteropServices;public static class test{[DllImport(\"user32.dll\", EntryPoint = \"SystemParametersInfo\")]public static extern bool SystemParametersInfo(uint uiAction, uint uiParam, uint pvParam, uint fWinIni);}';[test]::SystemParametersInfo(0x0057,0,$null,0)" |
|