Windows system modifies remote Port batch processing

Source: Internet
Author: User

Windows Server default port is "3389", this one port is very easy to be scanned by hackers, generally installed the server system will be the system's remote port changes, which need to change the value of two keys in the registry, For a lot of people who don't know, or if it's like saving something, you might as well follow this batch file to modify the remote port.


Create a new text document on the desktop and copy the following code:

@echo Offcolor 0a:: Technical Support Hanyang Modify the title modify the Windows 2003/2008 Remote Desktop Services port number echo ************************************************* echo * Please enter the Remote Desktop port number you want to change, range: 1024-65535, cannot conflict with other ports *echo ******************************************* echo.set/p port= Please enter the port: REG add "Hklm\system\currentcontrolset\control\terminal server\wds\ Rdpwd\tds\tcp "/V portnumber/t reg_dword/d%port%/freg Add" hklm\system\currentcontrolset\control\terminal Server\ Winstations\rdp-tcp "/V portnumber/t reg_dword/d%port%/fnetsh Firewall set Opmode mode = enablenetsh Firewall set port Opening All-Web Enablenetsh firewall set portopening all 3389 remote-pre enablenetsh firewall set portopening all%port Enableecho.echo *******************************echo * Restart Remote Desktop *echo *******************************reg Add " Hklm\system\currentcontrolset\control\terminal Server "/V fdenytsconnections/t reg_dword/d 1/freg Add" HKLM\SYSTEM\ Currentcontrolset\control\terminal Server "/V fdenytsconnections/t reg_dword/d 0/fecho.echo Start restart the computer to take effect, select Start Mode: Echo Select 1 manual restart echo Select 2 Auto Restart set/p select= Please select 1,2:if "%select%" = = "1" goto Aif "%select%" = = "2" goto Bpauseexit:aecho exit, please manually restart the computer pauseexit:bshutdown-r-T 1pauseexit


After the copy is complete, the suffix name of the text document is changed to CMD or bat format, save, and must be restarted to take effect after execution.

This article is from the "Light Blue Wind" blog, be sure to keep this source http://1051236524.blog.51cto.com/5661514/1409359

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.