SHOW:
|
|
- or go back to the newest paste.
| 1 | @echo off | |
| 2 | - | |
| 2 | + | |
| 3 | :: ======================================================================== | |
| 4 | :: Enable Remote Desktop on Windows 7 via batch file | |
| 5 | :: - runs locally | |
| 6 | :: - remote is probably only work for domain PCs because of windows firewall | |
| 7 | :: - to run remotely: copy file to remote computer via smb | |
| 8 | :: use PSEXEC to connect to the remote computer and run batch | |
| 9 | - | :: - once run remote desktop will be accessible via domain name |
| 9 | + | :: - once run remote desktop will be accessible via domain name |
| 10 | :: ie: [machineName].{domain}.{suffix}
| |
| 11 | :: - updated 3/6/14 to force the reg entry and stop and start services differently | |
| 12 | - | |
| 12 | + | |
| 13 | ||
| 14 | echo disable firewall | |
| 15 | - | |
| 15 | + | |
| 16 | ||
| 17 | echo add firewall rule for RD | |
| 18 | - | |
| 18 | + | |
| 19 | ||
| 20 | echo auto start remote registry | |
| 21 | - | |
| 21 | + | |
| 22 | ||
| 23 | echo start remote registry | |
| 24 | - | |
| 24 | + | |
| 25 | ||
| 26 | - | reg add "HKLM\system\currentcontrolset\control\terminal server" /v "fDenyTSConnections" /t REG_DWORD /d 0x0 |
| 26 | + | |
| 27 | - | |
| 27 | + | reg add "HKLM\system\currentcontrolset\control\terminal server" /v "fDenyTSConnections" /t REG_DWORD /d 0x0 /f |
| 28 | ||
| 29 | echo make RD autostart | |
| 30 | - | |
| 30 | + | |
| 31 | ||
| 32 | echo make RD umRdp auto start | |
| 33 | - | |
| 33 | + | |
| 34 | ||
| 35 | echo stop umrdp | |
| 36 | - | |
| 36 | + | |
| 37 | ||
| 38 | - | net stop TermService&net start TermService |
| 38 | + | |
| 39 | - | |
| 39 | + | echo y|net stop TermService |
| 40 | net start TermService | |
| 41 | ||
| 42 | - | |
| 42 | + | |
| 43 | netsh advfirewall set currentprofile state on | |
| 44 | ||
| 45 | :: remove REM if you want to see what happens running locally | |
| 46 | REM pause |