Solved

Restarting a computer using a batch file

Posted on 2012-04-04
5
494 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
[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
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:
Christopher McKay 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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

This article shows the method of using the Resultant Set of Policy Tool to locate Group Policy that applies a particular setting.
Group policies can be applied selectively to specific devices with the help of groups. Utilising this, it is possible to phase-in group policies, over a period of time, by randomly adding non-members user or computers at a set interval, to a group f…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

728 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