Last active
August 6, 2019 17:21
-
-
Save jalbertbowden/811445d0530aae7d4da22ef9f1bcdf61 to your computer and use it in GitHub Desktop.
Scripts for turning off Firefox and Edge on Windows after idle time.
This file contains hidden or 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
| @echo off | |
| for /f "tokens=1 delims=" %%# in ('qprocess^|find /i /c /n "MicrosoftEdg"') do ( | |
| set count=%%# | |
| ) | |
| taskkill /F /IM MicrosoftEdge.exe /T | |
| taskkill /F /IM firefox.exe /T | |
| pause |
This file contains hidden or 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
| $prompt = new-object -comobject wscript.shell | |
| $answer = $prompt.popup("Are you still using the Internet?`n",5,"Alert Modal",3) | |
| if($answer -eq 6) {Write-Host "Yes was selected"} | |
| if($answer -eq 7) {Write-Host "No was selected"} | |
| if($answer -eq -1) { | |
| start-process "C:\Users\Albert Bowden\Desktop\powershell-scripts\kill-browsers.bat" -WindowStyle Hidden | |
| } | |
| if($answer -eq 2) {Write-Host "Canceled by user."} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment