南瓜园

 找回密码
 注册
查看: 1278|回复: 0

开启电脑远程桌面脚本

[复制链接]
发表于 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
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

QQ|小黑屋|手机版|Archiver|南瓜园

GMT+8, 2024-12-19 12:08 , Processed in 0.088141 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表