Download file remotely and then download requirements remotely
This commit is contained in:
parent
74648459f4
commit
d5e4f29963
12
OS/init.cmd
12
OS/init.cmd
@ -1,5 +1,9 @@
|
|||||||
@echo off
|
@echo off
|
||||||
xcopy "%~dp0\Boot" "C:\boot\" /s /e /h /q /y
|
set StagingDir=%TEMP%\SRBW
|
||||||
xcopy "%~dp0\boot.wim" "C:\sources\" /h /q /y
|
set RemoteURL="https://git.mrmeeb.stream/MrMeeb/sure-recover-boot-wiper/raw/branch/main/payload"
|
||||||
cd "%~dp0"
|
|
||||||
powershell -executionpolicy bypass -file "setuppe.ps1"
|
mkdir %StagingDir%
|
||||||
|
|
||||||
|
powershell -Command Invoke-WebRequest %RemoteURL%/run.ps1 -OutFile %StagingDir%\run.ps1
|
||||||
|
|
||||||
|
powershell -ExecutionPolicy bypass -File %StagingDir%\run.ps1 %RemoteURL%
|
@ -1,18 +1,19 @@
|
|||||||
$RemoteURL = "https://git.mrmeeb.stream/MrMeeb/sure-recover-boot-wiper/raw/branch/main/payload"
|
$RemoteURL = $args[0]
|
||||||
$StagingDir = "$TEMP\SRBW"
|
$StagingDir = $PSScriptRoot
|
||||||
|
|
||||||
|
Write-Host $RemoteURL
|
||||||
|
|
||||||
# Make staging directory
|
#Disable progress bars to make Invoke-WebRequest actually fast
|
||||||
mkdir -Path $StagingDir
|
$ProgressPreference = 'SilentlyContinue'
|
||||||
|
|
||||||
# Download compressed boot dir to Staging Dir
|
# Download compressed boot dir to Staging Dir
|
||||||
Invoke-WebRequest -Uri $RemoteURL/boot.zip -OutFile $StagingDir\boot.zip
|
Invoke-WebRequest -Uri $RemoteURL/boot.zip -OutFile $StagingDir\boot.zip
|
||||||
|
|
||||||
# Expand boot.zip to C:\Boot
|
# Expand boot.zip to C:\Boot
|
||||||
Expand-Archive -Path $StagingDir\boot.zip -DestinationPath C:\boot
|
Expand-Archive -Path $StagingDir\boot.zip -DestinationPath C:\boot -Force
|
||||||
|
|
||||||
# Download WinPE wim to C:\Sources\boot.wim
|
# Download WinPE wim to C:\Sources\boot.wim
|
||||||
mkdir -Path C:\Sources
|
New-Item -ItemType "Directory" -Path C:\Sources -Force
|
||||||
Invoke-WebRequest -Uri $RemoteURL/boot.wim -OutFile C:\Sources\boot.wim
|
Invoke-WebRequest -Uri $RemoteURL/boot.wim -OutFile C:\Sources\boot.wim
|
||||||
|
|
||||||
|
|
||||||
@ -74,4 +75,6 @@ function BootToPE {
|
|||||||
bcdedit /bootsequence $LTGUID
|
bcdedit /bootsequence $LTGUID
|
||||||
shutdown /r /f /t 0
|
shutdown /r /f /t 0
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Remove-Item -Path $StagingDir -Recurse
|
Loading…
x
Reference in New Issue
Block a user