Modify Remote Desktop 3389 port with VBS and add code to Windows Firewall _vbs
Source: Internet
Author: User
Save the following code as a. vbs, and double-click to run. Then reboot the system and modify the default 3389 port on the system's Remote Desktop
'#####################
' VBS modifies the default port for Remote Desktop and adds it to Windows Firewall
' Author 51windows.net
' 56868 is the port you want to set
'#####################
Function Addfirewall (name,port,state)
Set Objfirewall = CreateObject ("Hnetcfg.fwmgr")
Set Objpolicy = ObjFirewall.LocalPolicy.CurrentProfile
Set Objport = CreateObject ("Hnetcfg.fwopenport")
Objport.port = Port
Objport.name = Name
objport.enabled = State
Set colports = Objpolicy.globallyopenports
Errreturn = Colports.add (objport)
End Function
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.