开启电脑远程桌面脚本
Const ENABLE_CONNECTIONS = 1strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_TerminalServiceSetting")
For Each objItem in colItems
errResult = objItem.SetAllowTSConnections(ENABLE_CONNECTIONS)
Next
set oShell= WScript.CreateObject("WScript.shell")
oShell.run "cmd.exe /c netsh firewall add portopening tcp 3389 RemoteDestop",0,true
set oShell=nothing
页:
[1]