@echo off
setlocal
title ORBS LAN Backup Host Setup - NO WORK ORDER
echo.
echo ORBS LAN BACKUP HOST SETUP - NO WORK ORDER
echo STANDARD TRUSTED LAN / HOME - ONE-TIME BACKUP HOST
echo.
set "ORBSPS1=%TEMP%\ORBS-LAN-Backup-Host-Setup-NO-WO.ps1"
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "[Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -UseBasicParsing 'https://orbscomputers.com/cleaning-tool/ORBS-LAN-Backup-Host-Setup-NO-WO.ps1' -OutFile $env:ORBSPS1"
if errorlevel 1 (
  echo.
  echo Download failed. Nothing was changed.
  pause
  exit /b 1
)
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "$h=(Get-FileHash -LiteralPath $env:ORBSPS1 -Algorithm SHA256).Hash.ToUpperInvariant(); if($h -ne 'FC8445145AFDAAF876DFB726AAA0D96DD659BA417D691796A65302D6D277511A'){Write-Host ('REFUSED: wrapper SHA mismatch: '+$h) -ForegroundColor Red; exit 5}"
if errorlevel 1 (
  echo.
  echo Security verification failed. Nothing was started.
  pause
  exit /b 5
)
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Start-Process powershell.exe -Verb RunAs -ArgumentList ('-NoProfile -NoExit -ExecutionPolicy Bypass -File \"'+$env:ORBSPS1+'\"')"
if errorlevel 1 (
  echo.
  echo Administrator launch was cancelled or failed.
  pause
  exit /b 1
)
exit /b 0
