@echo off :: Enable WinRM for Remote Management :: Run as Administrator echo ============================================ echo Enable WinRM for ShopDB Remote Management echo ============================================ echo. :: Check for admin rights net session >nul 2>&1 if %errorLevel% neq 0 ( echo ERROR: Please run as Administrator! echo Right-click and select "Run as administrator" pause exit /b 1 ) echo Enabling WinRM... powershell -Command "Enable-PSRemoting -Force -SkipNetworkProfileCheck" 2>nul echo. echo Setting firewall rules... powershell -Command "Set-NetFirewallRule -Name 'WINRM-HTTP-In-TCP' -Enabled True -Profile Any" 2>nul netsh advfirewall firewall add rule name="WinRM-HTTP" dir=in localport=5985 protocol=TCP action=allow >nul 2>&1 echo. echo Starting WinRM service... sc config winrm start= auto >nul net start winrm >nul 2>&1 echo. echo ============================================ echo WinRM Enabled Successfully! echo This PC can now be remotely managed. echo ============================================ echo. echo Hostname: %COMPUTERNAME% echo. pause