Solved

Autoit restart command not working

Posted on 2016-09-23
6
42 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

759 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now