@setlocal EnableDelayedExpansion EnableExtensions @for %%i in (a:\_packer_config*.cmd) do @call "%%~i" @if defined PACKER_DEBUG (@echo on) else (@echo off) echo ==^> Enabling RDP on port 3389 netsh advfirewall firewall add rule name="Open Port 3389" dir=in action=allow protocol=TCP localport=3389 reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f :exit0 @ping 127.0.0.1 @ver>nul @goto :exit :exit1 @ping 127.0.0.1 @verify other 2>nul :exit @echo ==^> Script exiting with errorlevel %ERRORLEVEL% @exit /b %ERRORLEVEL%