很难,不过你可以看看下面的
通过修改注册表打开或关闭Windows防火墙端口,以远程桌面端口3389为例: SetPort.bat @echo offSET TS=HKLM\SYSTEM\CurrentControlSet\Control\Terminal ServerSET LIST=HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\ParametersSET LIST=%LIST%\FirewallPolicy\StandardProfile\GloballyOpenPorts\List :: 打开3389端口IF [%1]==[TRUE] ( ECHO %TS% ECHO %LIST% reg add %TS% /v fDenyTSConnections /t REG_DWORD /d 0 /f reg add %LIST% /v 3389:TCP /t REG_SZ /d 3389:TCP:*:Enabled:@xpsp2res.dll,-22009 /f ECHO Enable Remote Desktop OK! GOTO END) :: 关闭3389端口IF [%1]==[FALSE] ( ECHO %TS% ECHO %LIST% ............
取消
评论