@echo off setlocal EnableExtensions title Super Helt POS Direct Print Setup color 0A set "POS_URL=https://bill.thesuperhelt.com/pos/index.php" set "APP_DIR=%LocalAppData%\SuperHeltPOS" set "PROFILE_DIR=%APP_DIR%\ChromeProfile" set "CHROME=%ProgramFiles%\Google\Chrome\Application\chrome.exe" if not exist "%CHROME%" set "CHROME=%ProgramFiles(x86)%\Google\Chrome\Application\chrome.exe" if not exist "%CHROME%" set "CHROME=%LocalAppData%\Google\Chrome\Application\chrome.exe" echo. echo ============================================================ echo SUPER HELT POS - ONE CLICK DIRECT PRINT SETUP echo ============================================================ echo. if not exist "%CHROME%" ( echo [ERROR] Google Chrome was not found. echo Install Google Chrome, then run this setup again. echo. pause exit /b 1 ) if not exist "%APP_DIR%" mkdir "%APP_DIR%" >nul 2>&1 if not exist "%PROFILE_DIR%" mkdir "%PROFILE_DIR%" >nul 2>&1 set "SH_POS_CHROME=%CHROME%" set "SH_POS_PROFILE=%PROFILE_DIR%" set "SH_POS_URL=%POS_URL%" echo [1/3] Chrome found. echo [2/3] Creating dedicated direct-print profile. echo [3/3] Creating desktop shortcut. powershell -NoProfile -ExecutionPolicy Bypass -Command "$q=[char]34; $desktop=[Environment]::GetFolderPath('Desktop'); $ws=New-Object -ComObject WScript.Shell; $path=Join-Path $desktop 'Super Helt POS - Direct Print.lnk'; $s=$ws.CreateShortcut($path); $s.TargetPath=$env:SH_POS_CHROME; $s.Arguments='--user-data-dir='+$q+$env:SH_POS_PROFILE+$q+' --app='+$q+$env:SH_POS_URL+$q+' --kiosk-printing --start-maximized --no-first-run --no-default-browser-check --disable-default-apps'; $s.WorkingDirectory=Split-Path $env:SH_POS_CHROME; $s.IconLocation=$env:SH_POS_CHROME+',0'; $s.Description='Super Helt POS with automatic direct printing'; $s.Save()" if errorlevel 1 ( echo. echo [ERROR] Desktop shortcut could not be created. pause exit /b 1 ) echo. echo Setup complete. echo Desktop shortcut: Super Helt POS - Direct Print echo Printing will use the current Windows default printer. echo Login once in the dedicated POS window; future launches remember it. echo. echo Restarting only the dedicated Super Helt POS window... powershell -NoProfile -ExecutionPolicy Bypass -Command "$profile=$env:SH_POS_PROFILE; Get-CimInstance Win32_Process | Where-Object { $_.Name -eq 'chrome.exe' -and $_.CommandLine -and $_.CommandLine.Contains($profile) } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue }" timeout /t 2 /nobreak >nul echo Starting Super Helt POS in direct-print mode... start "Super Helt POS" "%CHROME%" --user-data-dir="%PROFILE_DIR%" --app="%POS_URL%" --kiosk-printing --start-maximized --no-first-run --no-default-browser-check --disable-default-apps endlocal exit /b 0