Change RDP Listening Port from command Line

I want to change the RDP Listening port on a number  of Windows XP Pro PC's from the command line. I know the key to be changed is:-HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-TCP\PortNumber but need to use one of the registry edititing utilities such as Regfind or regini. Have tried but cannot figure out the exact syntax. Any help appreciated...
Who is Participating?
arshanaConnect With a Mentor Commented:
Windows XP comes inbuilt with a command line based registry editor called reg.exe . Using it you can modify add or remove entries from registry . For details visit if you still need help reply back.
Pete LongConnect With a Mentor Technical ConsultantCommented:
Hello Chrissycan,

export the registry key to a .reg file put it in a server share

regedit /s \\servername\sharename\new.reg


REG ADD HKLM\system\CurrentControlSet\Control\TerminalServer\winstations\rdp-tcp /v PortNumber /t REG_DWORD /d 0xd3e
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

ChrissycanAuthor Commented:
Thanks both...
Arshama I think your answer is simple and what I am looking for but when I run it I get an error saying "to many command line parameters". Also I think I need a space between "Terminal" and "Server".  Any further ideas?.
You are getting the  error because you are using the space. You dont have to use the space between the Terminal Server
ChrissycanAuthor Commented:
Thanks again...
If I leave the space out it creates another key "TerminalServer" at the same level as "Terminal Server".

Henrik JohanssonConnect With a Mentor Systems engineerCommented:
It shall be spaced, but you nead to place quotes around the spaced parameter.

reg add "HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber /t REG_DWORD /d 0xd3e 

Open in new window

ChrissycanAuthor Commented:
Thats it working...Thanks to all...Hope the points have been awarded fairly...
Pete LongTechnical ConsultantCommented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.