?
Solved

Autoit restart command not working

Posted on 2016-09-23
6
Medium Priority
?
158 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Setting up LaraDock for Laravel

Learn how to set up LaraDock in a Laravel project - LaraDock gives us an easy way to run a Laravel application using Docker in a single command.

 
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 2000 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

Application Discovery Service in AWS

In the era of the cloud, customers migrating away from their existing on-premise infrastructure. This requires lots of planning, strategies, and effort to identify their existing resources and determine how best to migrate.  Datacenter migrations happen in four phases -

Question has a verified solution.

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

In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Suggested Courses

762 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