在只有CMDSHELL的情况下查终端端口号的好工具,参考网上流行的代码改为Echo输出的。。。。(在用到转义字符 ^ 时遇到了点儿小麻烦,还是让我给解决了)
以下代码存为 Port.bat ,CMD下复制运行即可,我做了个提供大家下载。。。
http://www.03389.com/BLOG/UploadFiles/2007-5/513209722.rar
以下代码存为 Port.bat ,CMD下复制运行即可,我做了个提供大家下载。。。
http://www.03389.com/BLOG/UploadFiles/2007-5/513209722.rar
QUOTE:
Echo Dim ReadComputerName >>port.vbs
Echo Set ReadComputerName=WScript.CreateObject("WScript.Shell") >>port.vbs
Echo Dim TSName,TSRegPath >>port.vbs
Echo TSRegPath="HKLM/System/CurrentControlSet/Control/Terminal Server/WinStations/RDP-Tcp/PortNumber" >>port.vbs
Echo TSName=ReadComputerName.RegRead(TSRegPath) >>port.vbs
Echo WScript.Echo("TermService port is:"^&TSName) >>port.vbs
Cscript port.vbs
Echo Set ReadComputerName=WScript.CreateObject("WScript.Shell") >>port.vbs
Echo Dim TSName,TSRegPath >>port.vbs
Echo TSRegPath="HKLM/System/CurrentControlSet/Control/Terminal Server/WinStations/RDP-Tcp/PortNumber" >>port.vbs
Echo TSName=ReadComputerName.RegRead(TSRegPath) >>port.vbs
Echo WScript.Echo("TermService port is:"^&TSName) >>port.vbs
Cscript port.vbs