[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Autoit restart command not working

Posted on 2016-09-23
6
Medium Priority
?
189 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
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…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

649 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