0

I am working on a LabVIEW application and built an installer out of it. I need to restart the computer with the user consent after installing the application. At the moment, I am running a batch file automatically after installation that restarts the computer without an option for the user to abort it.

I am using the following command: shutdown /r. This command restarts the computer after a minute.

Is there a way to open the restart computer window with options "Restart Now", "Restart Later" and "Cancel" so that the user can decide what should happen next?

1 Answer 1

0

You could use PsShutdown which has a -c option that allows the user to cancel the shutdown:

enter image description here


Since you say you are using a batch file, you could also ask the user on the command line if they want to restart using choice:

CHOICE /m Restart
IF %ERRORLEVEL% EQU 2 goto NO_RESTART

PsShutdown -c <OTHER ARGS>

:NO_RESTART
1
  • Thanks, I will give it a try and see if it works.
    – Bala Gopi
    Jan 2, 2020 at 14:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .