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

x
?
Solved

Restarting a computer using a batch file

Posted on 2012-04-04
5
Medium Priority
?
507 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 1000 total points
ID: 37807765
shutdown /r
0
 
LVL 22

Accepted Solution

by:
Christopher McKay earned 1000 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Always backup Domain, SYSVOL etc.using processes according to Microsoft Best Practices. This is meant as a disaster recovery process for small environments that did not implement backup processes and did not run a secondary domain controller that ne…
Let's recap what we learned from yesterday's Skyport Systems webinar.
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Suggested Courses

656 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