1754752896
This commit is contained in:
@@ -11,9 +11,10 @@ $wait_minutes = (($Hours*60)+$Minutes)
|
|||||||
# $wait_seconds = ($wait_minutes*60)
|
# $wait_seconds = ($wait_minutes*60)
|
||||||
$total_wait_minutes = ($wait_minutes+$grace_minutes)
|
$total_wait_minutes = ($wait_minutes+$grace_minutes)
|
||||||
$total_wait_seconds = ($total_wait_minutes*60)
|
$total_wait_seconds = ($total_wait_minutes*60)
|
||||||
# $grace_seconds = ($grace_minutes*60)
|
$grace_seconds = ($grace_minutes*60)
|
||||||
$reboot_time = $((Get-Date).AddHours($Hours).AddMinutes($Minutes + $grace_minutes).ToString("hh:mm:ss tt"))
|
$reboot_time = $((Get-Date).AddHours($Hours).AddMinutes($Minutes + $grace_minutes).ToString("hh:mm:ss tt"))
|
||||||
# Write-Host "wait_seconds $wait_seconds wait_minutes $wait_minutes hours $Hours minutes $Minutes grace_seconds $grace_seconds grace_minutes $grace_minutes total_wait_minutes $total_wait_minutes reboot_time $reboot_time"
|
# Write-Host "wait_seconds $wait_seconds wait_minutes $wait_minutes hours $Hours minutes $Minutes grace_seconds $grace_seconds grace_minutes $grace_minutes total_wait_minutes $total_wait_minutes reboot_time $reboot_time"
|
||||||
|
$popup_shell = New-Object -ComObject 'WScript.Shell'
|
||||||
|
|
||||||
Write-Host "`nFORCING YOUR STUPID ASS OFF IN $Hours hours $Minutes minutes plus $grace_minutes minutes grace period`n"
|
Write-Host "`nFORCING YOUR STUPID ASS OFF IN $Hours hours $Minutes minutes plus $grace_minutes minutes grace period`n"
|
||||||
|
|
||||||
@@ -30,6 +31,8 @@ Write-Host "`nSleeping for $Hours hours $Minutes minutes and forking to backgrou
|
|||||||
|
|
||||||
webhook "SCHEDULED REBOOT AT $reboot_time"
|
webhook "SCHEDULED REBOOT AT $reboot_time"
|
||||||
|
|
||||||
|
$popup_shell.Popup("REBOOTING BY FORCE IN $Hours HOURS $Minutes MINUTES AT $reboot_time", 2, "REBOOTING AS FUCK IN $total_wait_minutes MINUTES", 0)
|
||||||
|
|
||||||
function do_admin_shit {
|
function do_admin_shit {
|
||||||
# handle interactive shit right away
|
# handle interactive shit right away
|
||||||
## schedule chkdsk to take up fuckin tons of time
|
## schedule chkdsk to take up fuckin tons of time
|
||||||
@@ -37,15 +40,16 @@ function do_admin_shit {
|
|||||||
# Start-Process -Verb RunAs -FilePath cmd.exe -ArgumentList '/K "chkdsk /r E: && chkdsk /r D: && chkdsk /r C: && exit"'
|
# Start-Process -Verb RunAs -FilePath cmd.exe -ArgumentList '/K "chkdsk /r E: && chkdsk /r D: && chkdsk /r C: && exit"'
|
||||||
## must use fuckin cmd bullshit grumble grumble
|
## must use fuckin cmd bullshit grumble grumble
|
||||||
## cancel with shutdown /a
|
## cancel with shutdown /a
|
||||||
shutdown /f /r /t $total_wait_seconds
|
# shutdown /f /r /t $total_wait_seconds
|
||||||
|
|
||||||
# sleep
|
# sleep
|
||||||
Start-Sleep -Seconds $total_wait_seconds
|
Start-Sleep -Seconds $total_wait_seconds
|
||||||
|
|
||||||
## popup
|
# popup
|
||||||
$shell = New-Object -ComObject 'WScript.Shell'
|
## $popup_shell.Popup(string <MESSAGE>, int <MODE>, string <WINDOW_TITLE>, int <CONTROLS>)
|
||||||
# $shell.Popup(string <MESSAGE>, int <MODE>, string <WINDOW_TITLE>, int <CONTROLS>)
|
$popup_shell.Popup("REBOOTING BY FORCE IN $grace_minutes MINUTES", 2, "REBOOTING AS FUCK IN $grace_minutes MINUTES", 0) ## reboot, force, delay $grace_seconds seconds
|
||||||
$shell.Popup("REBOOTING BY FORCE IN $grace_minutes MINUTES", 2, "REBOOTING AS FUCK IN $grace_minutes MINUTES", 0) ## reboot, force, delay $grace_seconds seconds
|
Start-Sleep -Seconds $grace_seconds
|
||||||
|
|
||||||
|
Start-Process -Verb RunAs -FilePath powershell.exe -ArgumentList '-C "Start-MpWDOScan"'
|
||||||
}
|
}
|
||||||
|
|
||||||
do_admin_shit | Out-Null
|
do_admin_shit | Out-Null
|
||||||
Reference in New Issue
Block a user