在CMD下读取服务器终端的端口的代码
程序员文章站
2022-04-10 18:45:17
复制代码 代码如下: regedit /e c:\\tsport.reg "hkey_local_machine\system\currentcontrolset\cont...
复制代码 代码如下:
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进制十进制互转工具
使用后:
上一篇: 通过U盘实现本机添加管理员权限