- Jalankan script ini di RDP
- Restart RDP
- Login ke RDP dengan IP:5050
Last active
December 20, 2022 06:57
-
-
Save kripul/3663ffa6528c93075a1e49d637bb39cb to your computer and use it in GitHub Desktop.
Custom RDP Port.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
cd.>%windir%\GetAdmin | |
if exist %windir%\GetAdmin (del /f /q "%windir%\GetAdmin") else ( | |
echo CreateObject^("Shell.Application"^).ShellExecute "%~s0", "%*", "", "runas", 1 >> "%temp%\Admin.vbs" | |
"%temp%\Admin.vbs" | |
del /f /q "%temp%\Admin.vbs" | |
exit /b 2) | |
set 5050 | |
set RULE_NAME="Open Port %PORT%" | |
netsh advfirewall firewall show rule name=%RULE_NAME% >nul | |
if not ERRORLEVEL 1 ( | |
rem Rule %RULE_NAME% already exists. | |
echo Hey, you already got a out rule by that name, you cannot put another one in! | |
) else ( | |
echo Rule %RULE_NAME% does not exist. Creating... | |
netsh advfirewall firewall add rule name=%RULE_NAME% dir=in action=allow protocol=TCP localport=%PORT% | |
) | |
reg add "HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber /t REG_DWORD /d 5050 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment