Solved

Autoit restart command not working

Posted on 2016-09-23
6
69 Views
Last Modified: 2016-09-23
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
0
Comment
Question by:CityInfoSys
  • 3
  • 3
6 Comments
 
LVL 14

Expert Comment

by:Schnell Solutions
ID: 41812550
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.
0
 
LVL 1

Author Comment

by:CityInfoSys
ID: 41812561
Would i need to run this as run("Shutdown /f /r /t 00")? Or another way?
0
 
LVL 14

Expert Comment

by:Schnell Solutions
ID: 41812571
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?
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 1

Author Comment

by:CityInfoSys
ID: 41812578
I am using it in an Autoit script.
0
 
LVL 14

Accepted Solution

by:
Schnell Solutions earned 500 total points
ID: 41812600
Ohs, Ok. With Autoit it should be dome exactly as the same example that you put before. Or you can also help it a bit specifying the full location of the command and its full name. In that way we ensure that it will not have problems finding the source file:

Run(“c:\windows\system32\shutdown.exe /f /r /t 0”)
0
 
LVL 1

Author Closing Comment

by:CityInfoSys
ID: 41812656
That worked.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Building Windows 10 1 83
Studying Angular for employability 5 87
Scripting vs. Programming languages 25 166
Powershell Script need assistance to make some changes 4 81
This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
This article will show, step by step, how to integrate R code into a R Sweave document
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question