lwexe
新手上路
积分 8
发帖 8
注册 2010-8-11
状态 离线
|
『楼 主』:
如何让修改注册表的批处理在计划任务中正常执行?
第一种
echo Windows Registry Editor Version 5.00 > ip.reg
echo. >> ip.reg
echo [HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\Network Connections] >> ip.reg
Rem 这个选项是禁止TCPIP协议属性的
echo "NC_LanChangeProperties"=dword:00000000 >> ip.reg
echo. >> ip.reg
Rem 这个选项是指管理员权限是否受限制
echo [HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\Network Connections] >> ip.reg
echo "NC_EnableAdminProhibits"=dword:00000001 >> ip.reg
regedit /s ip.reg
del ip.reg
另一种
reg add "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\Network Connections" /v NC_LanChangeProperties /t reg_dword /d 00000001 /f
reg add "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\Network Connections" /v NC_EnableAdminProhibits /t reg_dword /d 00000001 /f
以上两种单独运行都可以,放到计划任务中就失效了!或是写成注册表文用BAT来导入也不行!(帮看看,要求上面的在放到计划任务中调用也能运行)
同样的是注册表操作,下面的这段,不管是在计划任务,还是单独的就可以!或是写成注册表文用BAT来导入一样OK!
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR]
"Type"=dword:00000001
"Start"=dword:00000004
"ErrorControl"=dword:00000001
"ImagePath"=hex(2):73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,44,00,\
52,00,49,00,56,00,45,00,52,00,53,00,5c,00,55,00,53,00,42,00,53,00,54,00,4f,\
00,52,00,2e,00,53,00,59,00,53,00,00,00
"DisplayName"="USB 程式"
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR\Security]
"Security"=hex:01,00,14,80,a0,00,00,00,ac,00,00,00,14,00,00,00,30,00,00,00,02,\
00,1c,00,01,00,00,00,02,80,14,00,ff,01,0f,00,01,01,00,00,00,00,00,01,00,00,\
00,00,02,00,70,00,04,00,00,00,00,00,18,00,fd,01,02,00,01,01,00,00,00,00,00,\
05,12,00,00,00,74,00,6c,00,00,00,1c,00,ff,01,0f,00,01,02,00,00,00,00,00,05,\
20,00,00,00,20,02,00,00,00,00,00,00,00,00,18,00,8d,01,02,00,01,01,00,00,00,\
00,00,05,0b,00,00,00,20,02,00,00,00,00,1c,00,fd,01,02,00,01,02,00,00,00,00,\
00,05,20,00,00,00,23,02,00,00,00,00,00,00,01,01,00,00,00,00,00,05,12,00,00,\
00,01,01,00,00,00,00,00,05,12,00,00,00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR\Enum]
"0"="USB\\Vid_0c76&id_0007\\6&358319c3&0&4"
"Count"=dword:00000001
"NextInstance"=dword:00000001
请懂的朋友看看是怎么回事,帮解决一下!
[ Last edited by lwexe on 2010-8-23 at 10:02 ]
|
|