I need a Windows 10 batch file that queries the system for its last system reboot then performs one of the following tasks based on days since last BootUp:
3 days: a popup box that says "Please restart your computer at end of the day"
6 days: a popup box that says "System is restarting, please close all documents & press OK" - after uses clicks "OK", system restarts
9+ days: a popup box says "System is restarting in 90 seconds" - execute shutdown -r - t 90 -f
These commands will provide most lastBootUpTime:
- wmic os get lastBootUpTime
- wevtutil qe System "/q:*[System[(EventID=6005)]]" /f:text /rd:true /c:1 | find "Date:"
- (gwmi win32_operatingSystem).lastbootuptime
Many ways to create a popup, here is a simple one: Msg * "Please restart your computer at end of the day"
14 freelanceria on tarjonnut keskimäärin %project_bid_stats_avg_sub_26% %project_currencyDetails_sign_sub_27% tähän työhön
You have most of the commands sorted out, i can get you the script made so it does your three required tasks. I can get it done within the day, as long as it gets approved and i am online.