VBS-更改mstsc端口
Set WshShell=CreateObject("Wscript.Shell") Function Imput...
扫描右侧二维码阅读全文
23
2008/07

VBS-更改mstsc端口

Set WshShell=CreateObject("Wscript.Shell")
Function Imput()

'定义更改端口输入框
imputport=InputBox("请输入一个端口号,注意:这个端口号目前不能被其它程序使用,否则会影响终端服务"," 更改终端端口号", "3389", 100, 100)
If imputport<>"" Then '判断不为空
If IsNumeric(imputport) Then '判断输入端口为数字

'更改注册表

WshShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp\PortNumber",imputport,"REG_DWORD"
WshShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\PortNumber",imputport,"REG_DWORD"
wscript.echo "操作成功"
Else wscript.echo "输入出错,请重新输入"
Imput()
End If
Else wscript.echo "操作已经取消"
End If
End Function
Imput()
set WshShell=nothing

Last modification:November 26th, 2018 at 04:16 pm
If you think my article is useful to you, please feel free to appreciate

2 comments

  1. 3ice

    JOHN 是什么人?难道还没找到工作么。。。汗

  2. Michael Field

    呵呵 也是我们的以前的同事,只是现在都不在一个公司啦。

Leave a Comment