Avatar of CityInfoSys
CityInfoSys
Flag for United States of America asked on

Autoit restart command not working

I wrote an Autoit script to reboot the computer after running an uninstall of Office 2007 however, it just logs off the user and never reboots. The command I am using is Shutdown(2) and I have also tried Shutdown(4) . Should i use the windows built in shutdown command? Shutdown /f /r /t 00 ?
Thanks

Clients Windows 10 x64 pro
Scripting Languages

Avatar of undefined
Last Comment
CityInfoSys

8/22/2022 - Mon
Ogandos

Shutdown /f /r /t 00

Yes, this command will restart your system completely using a forced way /f (if there is something open will be forced to close), /r (restart) and /t 00 (immediately, 0 seconds).

When you configure the task, use an administrative account, the system account or any other account with the necessary privileges.
CityInfoSys

ASKER
Would i need to run this as run("Shutdown /f /r /t 00")? Or another way?
Ogandos

It depends how you want to run it.

1. If you want to use one script file, you can create a file ending with .bat or .cmd and add exactly this line:
Shutdown /f /r /t 00
Then you save the file and instruct your schedule application to run your script.

2. If you are configuring a task, usually the entire command is introduced (depending the task program used), the syntax could be...

a) Shutdown /f /r /t 00

or

b) shutdown
and in a different field you put the parameters: /f  /r  /t 00

How are you planning to make it?
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
CityInfoSys

ASKER
I am using it in an Autoit script.
ASKER CERTIFIED SOLUTION
Ogandos

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
CityInfoSys

ASKER
That worked.