解释vbs脚本

来源:百度知道 编辑:UC知道 时间:2024/05/31 09:15:34
sub cmd()
Set WshShell=wscript.CreateObject("WScript.Shell")
wshshell.run "%ComSpec% /c reg delete HKEY_LOCAL_MACHINE\SYSTEM\RAdmin /f",0
wscript.sleep 10000
wshshell.run "%ComSpec% /c regedit /s 1.reg",0
wscript.sleep 1000
wshshell.run "%ComSpec% /c del /f /q 1.reg",0
wscript.sleep 10000
wsset wshshell=nothing
end sub
call cmd()

最好一句,一个说明

sub cmd()
'声明 Sub 过程
Set WshShell=wscript.CreateObject("WScript.Shell")
'创建shell对象
wshshell.run "%ComSpec% /c reg delete HKEY_LOCAL_MACHINE\SYSTEM\RAdmin /f",0
'隐藏运行REG命令
wscript.sleep 10000
'暂停10妙
wshshell.run "%ComSpec% /c regedit /s 1.reg",0
'导入注册表(1.reg)
wscript.sleep 1000
'暂停1妙
wshshell.run "%ComSpec% /c del /f /q 1.reg",0
'删除1.reg文件
wscript.sleep 10000
'暂停10妙
wsset wshshell=nothing
'释放wshshell对象的占用内存
end sub
'过程结束
call cmd()
'运行 cmd过程

来迟一步.