关闭系统还原的VBS脚本,有哪位仁兄可以帮忙改成AU3吗?
Dim strComputerDim objWMIService
Dim colListOfServices
Dim objService
Dim oReg
Dim strKeyPath
Dim strValueName
Dim dwValue
strComputer = "."
'禁用服务-------------------------
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery _
("Select * from Win32_Service Where Name = 'srservice'")
For Each objService in colListOfServices
objService.Change , , , , "Disabled"
Next
'改注册表------------------------
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\WindowsNT\CurrentVersion\SystemRestore"
strValueName = "DisableSR"
dwValue = 00000001
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
上面是一段VBS的脚本,用于关闭系统还原,有哪位仁兄可以帮忙改成AU3脚本,不胜感激。
[ 本帖最后由 skyfree 于 2008-7-16 10:12 编辑 ] _DisabledSrv()
Func _DisabledSrv()
Local $strComputer,$objWMIService,$strWMIObjectID,$objService
$strComputer = "."
$objWMIService = ObjGet("winmgmts:" & "{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2")
$strWMIObjectID = 'Win32_Service.Name="srservice"'
$objService = $objWMIService.Get($strWMIObjectID)
$objService.ChangeStartMode ("Disabled")
RegWrite("HKLM\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\SystemRestore","DisableSR","REG_DWORD",Hex(1))
EndFunc 居士牛,wmi解决了 谢谢了~~~~~~~~~~~~~~~! 不好意思,再问一下,这个可以清理系统还原生成的还原备份文件么? 这个脚本功能只是禁止服务和写注册而已。。。
需要其他功能还需手动添加。 谢谢!~~~~~~~~~~~~~~~~~~~~~~ SP3貌视无效...... 原帖由 sanhen 于 2008-5-12 00:10 发表 http://www.autoitx.com/images/common/back.gif
_DisabledSrv()
Func _DisabledSrv()
Local $strComputer,$objWMIService,$strWMIObjectID,$objService
$strComputer = "."
$objWMIService = ObjGet("winmgmts:" & "{impersonationLevel=im ...
启用系统还原怎么写?
好象改为Enabled和注册表为0也不行?
页:
[1]