Skip to content

Instantly share code, notes, and snippets.

View flevi29's full-sized avatar

F. Levi flevi29

  • 23:25 (UTC +02:00)
View GitHub Profile
@echo off
powershell -Command "$pth = \"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\"; Set-ItemProperty -Path $pth -Name \"ConsentPromptBehaviorAdmin\" -Value 1; Get-ItemProperty -Path $pth -Name \"ConsentPromptBehaviorAdmin\"; "
pause
@flevi29
flevi29 / offlineshutdown.bat
Created February 5, 2021 13:39
When internet connection is lost, or a certain amount of seconds passed, it shuts down the computer.
@echo off
title Automated shutdown
:: How many seconds*10 until power off ; 360 : 1 hour, < 1 : never,
set "tenSeconds=360"
if %tenSeconds% leq 0 (goto :ELSE)
set /a seconds="tenSeconds * 10"
echo|set /p="Waiting for internet connection to be lost or %seconds% seconds to then shut down . . ." & echo. & echo.