zhouqi0921 发表于 2010-5-5 17:42:27

开启电脑远程桌面脚本

Const ENABLE_CONNECTIONS = 1
    strComputer = "."
    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]
查看完整版本: 开启电脑远程桌面脚本

请大家牢记南瓜园网址 www.nan2008.com