Created
December 21, 2017 19:19
-
-
Save srpomeroy/fcb82dc197fe80290b640d3ca4c5eed7 to your computer and use it in GitHub Desktop.
Remove default OS timeout in Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$bcdConfig = & bcdedit.exe /enum | |
foreach($line in $bcdConfig) { | |
if ($line -like "timeout*") { | |
$timeout = $line.replace('timeout','').replace(' ','') | |
if($timeout -ne 0) { | |
Write-Output "Changing timeout from $timeout to 0" | |
& bcdedit.exe /timeout 0 | |
BREAK | |
} | |
else { | |
Write-Output "Current timeout is already 0. Nothing to do." | |
BREAK | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment