From e41d4a4bfa61292bc5a1af45ff89e0d4702f8be1 Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Sat, 27 Sep 2025 07:13:31 -0600 Subject: [PATCH] 1758978811 --- Windows-Scripts/force_me_off.ps1 | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Windows-Scripts/force_me_off.ps1 b/Windows-Scripts/force_me_off.ps1 index a279189..99b5384 100644 --- a/Windows-Scripts/force_me_off.ps1 +++ b/Windows-Scripts/force_me_off.ps1 @@ -62,13 +62,15 @@ webhook "FORCING OFF FROM WINDOWS AT $reboot_time" true # time wasters ## checks C drive after reboot to waste time and fix errors ## chkdsk /r C: # as admin -chkdsk /r C: +## make it do it noninteractively with echo y +## echo specifically seems needeed +echo y | chkdsk /r C: -$background_scriptblock = { - shutdown.exe -r -t ($total_wait_seconds+10) # 10 second bonus to defer to Start-MpWDOScan - Start-Sleep -Seconds $total_wait_seconds - Start-MpWDOScan -} +# shutdown tasks +## schedule normal shutdown as backup and for warnings +shutdown -f -r -t ($total_wait_seconds+10) # 10 second bonus to defer to Start-MpWDOScan +## do the actual reboot by triggerinmg Start-MpWDOScan +Start-Sleep -Seconds ($Seconds+60) && Write-Host "Start-MpWDOScan" && webhook "REBOOTAN <@&1369280290203373670>" # $test_background_scriptblock = { # Write-Host $total_wait_seconds @@ -76,11 +78,13 @@ $background_scriptblock = { # Start-Process "pwsh.exe" -Verb RunAs # } -$command_string = "-NoExit", "-WindowStyle", "Hidden", "-Command", "& { $background_scriptblock }" +# $command_string = "-NoExit", "-WindowStyle", "Hidden", "-Command", "& { $background_scriptblock }" # $test_command_string = "-Command ", "& { $test_background_scriptblock }" -Write-Host $test_command_string +# Write-Host $test_command_string # send it to background! -Start-Process -FilePath "pwsh.exe" -ArgumentList $command_string -Verb RunAs + + +# Start-Process pwsh -ArgumentList $command_string -Verb RunAs # Start-Process -FilePath "pwsh.exe" -ArgumentList $test_command_string -Verb RunAs \ No newline at end of file