Solved

Restarting a computer using a batch file

Posted on 2012-04-04
5
483 Views
Last Modified: 2012-04-04
I need  a batch file to restart a computer. It's a Win 7 box, so if there is a way in Win 7 to restart a machine on a schedule, then that would work just as well.

Else, I was planning on using Windows Task Scheduler to launch a .bat file.

As always, thanks in advance EE!

jpertchik
0
Comment
Question by:jpertchik
5 Comments
 
LVL 17

Expert Comment

by:Anuroopsundd
ID: 37807763
START C:\Windows\RUNDLL.EXE user.exe,exitwindowsexec
exit
0
 
LVL 17

Assisted Solution

by:Anuroopsundd
Anuroopsundd earned 250 total points
ID: 37807765
shutdown /r
0
 
LVL 22

Accepted Solution

by:
Bartender_1 earned 250 total points
ID: 37807766
you could use the shutdown command,

shutdown /r

this tells the system to shutdown and restart.

shutdown /g

this tells the system to restart, and then restart any registered applications,

shutdown /r /f

This tells the system to restart, and force any open applications to close.

Hope this helps!

:o)

Bartender_1
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 37807780
No batch file needed - from an elevated cmd prompt, type (or copy) the following:

schtasks /create /ru SYSTEM /sc daily /st 18:00 /tn Restart /tr "shutdown /r /f /t 0"
0
 

Author Closing Comment

by:jpertchik
ID: 37808028
Both had the right command.

Anuroopsundd's answer:
shutdown /r

Bartender_1's answer gave me the same command that I'll ultimately use, however he/she supplied more switches that might com in handy sometime.

you could use the shutdown command,

shutdown /r

this tells the system to shutdown and restart.

shutdown /g

this tells the system to restart, and then restart any registered applications,

shutdown /r /f

This tells the system to restart, and force any open applications to close.

Hope this helps!

:o)
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

Ever notice how you can't use a new drive in Windows without having Windows assigning a Disk Signature?  Ever have a signature collision problem (especially with Virtual Machines?)  This article is intended to help you understand what's going on and…
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

911 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

20 Experts available now in Live!

Get 1:1 Help Now