复制代码 代码如下:
regedit /e c:\\tsport.reg "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp"
type c:\\tsport.reg | find "PortNumber"
执行后:如图所示

注意:上面的代码获取的是16进制端口(000000d3d),所以需要转换为10进制的,才是大家所熟悉的3389等端口。
附送在线16进制十进制互转工具 https://www.jb51.net/tools/hexconv/
使用后:
