Quantcast
Channel: Windows 7 Miscellaneous forum
Viewing all articles
Browse latest Browse all 11372

Automatic reboots except when a user account is logged into the system

$
0
0

Hello --

I am creating a script that will reboot a Windows 7 system. The script was created using Notepad, and is saved as a batch file. Currently the script has the following text:

c:\windows\system32\shutdown.exe -F -R

My plan is to have the script scheduled to run, via the Task Scheduler, at 1:00 every morning. I was requested to add the following: If a user account is logged into the workstation at the scheduled time, then abort the reboot operation.

Is this something that can be done using the batch file? If not, would something like this be possible within PowerShell?

Thanks.


Viewing all articles
Browse latest Browse all 11372

Trending Articles