Win2008、2012系统免开防火墙启用3389功能

很多人对于WS2008、WS2012、Win10开启3389都有一个“错误的认知”。认为这些系统开3389的话,必须开启防火墙……事实上,只要设置3389时,启动防火墙即可,设置好了关闭防火墙就行,不会影响3389使用,因此3389并不需要一直开着防火墙。开个3389还要启用防火墙太麻烦,因此自己写了个bat,点下就能打开3389功能,有需要的自行拿走。

@echo off
Title 启用3389远程功能

@echo [启用3389功能]
Reg Add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /F 0> NUL 1> NUL 2> NUL
@echo [启动3389服务]
Reg Add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TermService" /v Start /t REG_DWORD /d 2 /F 0> NUL 1> NUL 2> NUL
net start TermService 0> NUL 1> NUL 2> NUL


ver | find "5.2." > NUL &&  goto old
ver | find "6.0." > NUL &&  goto new
ver | find "6.1." > NUL &&  goto new
ver | find "6.2." > NUL &&  goto new
ver | find "10.0." > NUL &&  goto new

:old
@echo [WinXP/Win2003禁用防火墙服务]
Reg Add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess" /v Start /t REG_DWORD /d 4 /F 0> NUL 1> NUL 2> NUL
net stop SharedAccess 0> NUL 1> NUL 2> NUL
@echo.
@echo 设置完成,3389远程时,被远程电脑必须有系统密码,如果未设置系统密码,请手工设置!
@echo.
pause
goto end

:new
@echo [Win7/Win8/Win10/Win2008/Win2012禁用防火墙服务]
Reg Add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MpsSvc" /v Start /t REG_DWORD /d 4 /F 0> NUL 1> NUL 2> NUL
net stop MpsSvc 0> NUL 1> NUL 2> NUL
@echo.
@echo 设置完成,3389远程时,被远程电脑必须有系统密码,如果未设置系统密码,请手工设置!
@echo.
pause
goto end
© 版权声明
THE END
喜欢就支持一下吧
点赞13赞赏
分享
评论 抢沙发

请登录后发表评论