vbs更改3389远程桌面端口的脚本
程序员文章站
2022-04-10 08:05:21
set wshshell=createobject("wscript.shell") function imput() imputport=inputb...
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
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
上一篇: discuz 任意管理员密码漏洞利用工具 vbs代码
下一篇: 用vbs实现的强制杀进程的脚本