1. ' 版本 2012 12 04 
  2. ' 作者 xiaoli110
  3. ' 实现原理 
  4. ' 修改注册表,打开远程桌面键值 
  5. ' 读取远程桌面端口数值,写入注册表 
  6.  
  7. rdp_port=38522 
  8.  
  9.  
  10. '修改注册表 打开远程桌面  修改端口 
  11. Set WshShell = WScript.CreateObject("WScript.Shell") 
  12. WshShell.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\fDenyTSConnections",0,"REG_DWORD" 
  13. WshShell.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp\PortNumber",rdp_port,"REG_DWORD" 
  14. WshShell.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\PortNumber",rdp_port,"REG_DWORD"