vbs更改3389远程桌面端口的脚本
发布时间:2016-12-28 来源:查字典编辑
摘要:SetWshShell=CreateObject("Wscript.Shell")FunctionImput()imputport=Inpu...
SetWshShell=CreateObject("Wscript.Shell")
FunctionImput()
imputport=InputBox("请输入一个端口号,注意:这个端口号目前不能被其它程序使用,否则会影响终端服务","更改终端端口号","3389",100,100)
Ifimputport<>""Then
IfIsNumeric(imputport)Then
WshShell.RegWrite"HKLMSYSTEMCurrentControlSetControlTerminalServerWdsrdpwdTdstcpPortNumber",imputport,"REG_DWORD"
WshShell.RegWrite"HKLMSYSTEMCurrentControlSetControlTerminalServerWinStationsRDP-TcpPortNumber",imputport,"REG_DWORD"
wscript.echo"操作成功"
Elsewscript.echo"输入出错,请重新输入"
Imput()
EndIf
Elsewscript.echo"操作已经取消"
EndIf
EndFunction
Imput()
setWshShell=nothing