最近在搞windows的自动化设置,其中发现2003和2008有一些不同之处,特此记录
windows 2003 开启远程桌面
@echo off
rem 开启远程桌面
echo Windows Registry Editor Version 5.00 > remote.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server]>> remote.reg
echo "fDenyTSConnections"=dword:00000000>> remote.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp]>> remote.reg
echo "PortNumber"=dword:00000d3d>> remote.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp]>> remote.reg
echo "PortNumber"=dword:00000d3d>> remote.reg
regedit /s remote.reg
del remote.reg
windows 2008 开启远程桌面
@echo off
rem 开启远程桌面
reg add "HKLM\SYSTEM\ControlSet001\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
netsh advfirewall firewall set rule group="Remote DeskTop" new enable=yes