How to warn user about reboot from system account?

1k views Asked by At

I created task by schtasks. This task starts on system start, runs in system account and forces Windows to reboot when it is finished. The task runs for 1-2 minutes. User knows that task is running, but he can forget about it. If user forget about this task he can login and start to do some work and after that suddenly system is turned off.

I want to warn user about coming reboot. Ideally system should show Welcome screen message (similar to message "Do not turn off your computer" when it is updating) and does not show login screen. But I do not know how to do this.

The other possible solution: show window with warning. I tried to show message box from task but it is not visible. Probably application running in system account cannot interact with user.

Can you help me? How to warn user about reboot? What is the easiest way?

1

There are 1 answers

2
Loïc MICHEL On

How do you reboot your server ? Shutdown.exe will naturally display a warning message, or you can add your own :

shutdown /r /t 300 /c "server is going to shutdown"