@echo off REM ===================================================== REM Complete PC Asset Collection - Batch Launcher REM Runs Update-PC-CompleteAsset.ps1 with execution policy bypass REM ===================================================== echo. echo Complete PC Asset Collection - Starting... echo ======================================== echo. REM Check if running as administrator net session >nul 2>&1 if %errorLevel% == 0 ( echo Running as Administrator: YES ) else ( echo. echo ERROR: This script must be run as Administrator! echo Right-click and select "Run as administrator" echo. pause exit /b 1 ) echo. echo Dashboard: http://10.48.130.197/test/dashboard/api.php echo PC: %COMPUTERNAME% echo User: %USERNAME% echo Note: Warranty lookups handled by dashboard server echo. REM Change to script directory cd /d "%~dp0" REM Check if PowerShell script exists if not exist "Update-PC-CompleteAsset.ps1" ( echo. echo ERROR: Update-PC-CompleteAsset.ps1 not found in current directory! echo Current directory: %CD% echo. pause exit /b 1 ) REM Check if shopfloor config script exists if not exist "Get-ShopfloorConfig.ps1" ( echo. echo WARNING: Get-ShopfloorConfig.ps1 not found! echo Shopfloor configuration collection may fail. echo. ) echo Starting complete asset collection... echo. REM Run PowerShell script with bypass execution policy powershell.exe -ExecutionPolicy Bypass -NoLogo -File "%~dp0Update-PC-CompleteAsset.ps1" REM Capture the exit code from PowerShell set PS_EXIT_CODE=%ERRORLEVEL% echo. echo ======================================== if %PS_EXIT_CODE% == 0 ( echo Complete asset collection SUCCESS! echo Exit code: %PS_EXIT_CODE% echo. echo All data has been collected and stored: echo - System information ^(hostname, serial, type, user^) echo - Shopfloor configurations ^(if applicable^) echo - Dell warranty information ^(if Dell system^) ) else ( echo Complete asset collection FAILED! echo Exit code: %PS_EXIT_CODE% echo. echo Check the output above for error details. ) echo. echo Press any key to close this window... pause >nul exit /b %PS_EXIT_CODE%