@echo off setlocal set "INSTALL_DIR=%LOCALAPPDATA%\SWAM\BrowserHelper" set "LAUNCHER_PATH=%INSTALL_DIR%\swam-browser-helper-launch.cmd" if not exist "%INSTALL_DIR%" mkdir "%INSTALL_DIR%" ( echo @echo off echo setlocal echo set "TARGET_URL=https://admin.microsoft.com" echo set "EDGE_X86=C:\Program Files ^(x86^)\Microsoft\Edge\Application\msedge.exe" echo set "EDGE_X64=C:\Program Files\Microsoft\Edge\Application\msedge.exe" echo set "CHROME_X64=C:\Program Files\Google\Chrome\Application\chrome.exe" echo set "CHROME_X86=C:\Program Files ^(x86^)\Google\Chrome\Application\chrome.exe" echo if exist "%%EDGE_X86%%" goto edge_x86 echo if exist "%%EDGE_X64%%" goto edge_x64 echo if exist "%%CHROME_X64%%" goto chrome_x64 echo if exist "%%CHROME_X86%%" goto chrome_x86 echo exit /b 1 echo :edge_x86 echo start "" "%%EDGE_X86%%" --new-window --inprivate "%%TARGET_URL%%" echo exit /b 0 echo :edge_x64 echo start "" "%%EDGE_X64%%" --new-window --inprivate "%%TARGET_URL%%" echo exit /b 0 echo :chrome_x64 echo start "" "%%CHROME_X64%%" --new-window --incognito "%%TARGET_URL%%" echo exit /b 0 echo :chrome_x86 echo start "" "%%CHROME_X86%%" --new-window --incognito "%%TARGET_URL%%" echo exit /b 0 ) > "%LAUNCHER_PATH%" if errorlevel 1 goto :fail reg add "HKCU\Software\Classes\swamhelper" /ve /d "URL:SWAM Browser Helper" /f >nul if errorlevel 1 goto :fail reg add "HKCU\Software\Classes\swamhelper" /v "URL Protocol" /d "" /f >nul if errorlevel 1 goto :fail reg add "HKCU\Software\Classes\swamhelper\DefaultIcon" /ve /d "%SystemRoot%\System32\SHELL32.dll,220" /f >nul if errorlevel 1 goto :fail reg add "HKCU\Software\Classes\swamhelper\shell\open\command" /ve /d "\"%ComSpec%\" /c \"\"%LAUNCHER_PATH%\" \"%%1\"\" " /f >nul if errorlevel 1 goto :fail echo SWAM Browser Helper installed successfully. echo Close this window and hard refresh SWAM. pause exit /b 0 :fail echo SWAM Browser Helper installation failed. echo Please send a screenshot of this window if it keeps happening. pause exit /b 1