写这样的批处理文件(.bat)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@echo off
color 0a
title 修改win远程桌面服务端口号
echo **********************************
echo 键入您要更改端口号
echo (范围:1-65535,不能与其他端口冲突)
echo **********************************
echo.
set /p port=请输入端口号:
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp" /v PortNumber /t reg_dword /d %port% /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber /t reg_dword /d %port% /f
echo.
echo *******************************
echo * 启动远程桌面功能,配置生效 *
echo *******************************
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t reg_dword /d 1 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t reg_dword /d 0 /f
echo.
echo 按任意键退出...
pause>nul
exit
阅读(1359) | 评论(1) | 转发(0) |