vbs更改3389遠(yuǎn)程桌面端口的腳本
更新時(shí)間:2008年05月20日 22:19:23 作者:
用vbscript實(shí)現(xiàn)的修改服務(wù)器3389端口的代碼,比較方便使用,不用每次都要進(jìn)注冊(cè)表修改,方便大家
Set WshShell=CreateObject("Wscript.Shell")
Function Imput()
imputport=InputBox("請(qǐng)輸入一個(gè)端口號(hào),注意:這個(gè)端口號(hào)目前不能被其它程序使用,否則會(huì)影響終端服務(wù)"," 更改終端端口號(hào)", "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 "輸入出錯(cuò),請(qǐng)重新輸入"
Imput()
End If
Else wscript.echo "操作已經(jīng)取消"
End If
End Function
Imput()
set WshShell=nothing
Function Imput()
imputport=InputBox("請(qǐng)輸入一個(gè)端口號(hào),注意:這個(gè)端口號(hào)目前不能被其它程序使用,否則會(huì)影響終端服務(wù)"," 更改終端端口號(hào)", "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 "輸入出錯(cuò),請(qǐng)重新輸入"
Imput()
End If
Else wscript.echo "操作已經(jīng)取消"
End If
End Function
Imput()
set WshShell=nothing
相關(guān)文章
用VBS精確計(jì)算100的階乘的實(shí)現(xiàn)代碼
運(yùn)行一下上面的程序,輸出2.43290200817664E+18。笑而不語(yǔ),再次證明了我之前的結(jié)論,在這種網(wǎng)站上回答問(wèn)題的,大部分水平都不咋地。2011-04-04
VBScript教程 第八課 使用循環(huán)語(yǔ)句
VBScript教程 第八課 使用循環(huán)語(yǔ)句...2006-11-11
VBS教程:VBscript屬性-Description 屬性
VBS教程:VBscript屬性-Description 屬性...2006-11-11
用vbscript實(shí)現(xiàn)隱藏任務(wù)欄圖標(biāo)的腳本
一個(gè)可以隱藏任務(wù)欄圖標(biāo)的腳本,方便需要隱藏任務(wù)欄圖標(biāo)的朋友2008-06-06

