开启远程桌面命令
wmic RDTOGGLE WHERE ServerName='%COMPUTERNAME%' call SetAllowTSConnections 1
#关闭远程桌面
wmic RDTOGGLE WHERE ServerName='%COMPUTERNAME%' call SetAllowTSConnections 0
#设置远程桌面端口(默认开启3389)
reg add "HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /t REG_DWORD /v portnumber /d 3389 /f
检查默认端口状态
netstat -an|find "3389"
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/216063.html原文链接:https://javaforall.net
