Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.



Windows 7: Creating .batch to run at shutdown

15 Jan 2012   #1

Windows 7 Ultimate Media Center Edition x64 SP1
 
 
Creating .batch to run at shutdown

I would like to know how to create a .batch file and have it run at the shut down of the computer,Here are the commands:

netsh int ip reset reset.log
netsh int ip delete arpcache
netsh winsock reset
ipconfig /flushdns

Thanks

My System SpecsSystem Spec
.

15 Jan 2012   #2

Windows 7 Home Premium 64 Bit
 
 

Task scheduler can set it up to run at startup or at login, but I do not see a method to do it at shut down.

You can use the group policy editor since you have Windows 7 Ultimate. See Schedule a task to execute at shutdown or logoff - Tech Support Forum for how to setup a task to run on shutdown using the group policy editor.
My System SpecsSystem Spec
15 Jan 2012   #3

Windows 7 Ultimate Media Center Edition x64 SP1
 
 

Thanks writhziden, But I was asking more along the lines of how to right the file so all the commands go through, when I paste it in to the cmd as admin the last one will not run with out pressing enter. So what I should say is does anyone know how to write a batch to run these commands:

netsh int ip reset reset.log
netsh int ip delete arpcache
netsh winsock reset
ipconfig /flushdns
My System SpecsSystem Spec
.


15 Jan 2012   #4

Windows 7 Home Premium 64 Bit
 
 

Quote   Quote: Originally Posted by jmh033089 View Post
Thanks writhziden, But I was asking more along the lines of how to right the file so all the commands go through, when I paste it in to the cmd as admin the last one will not run with out pressing enter. So what I should say is does anyone know how to write a batch to run these commands:

netsh int ip reset reset.log
netsh int ip delete arpcache
netsh winsock reset
ipconfig /flushdns
If you have a return carriage after each command (if you hit enter after each command within the batch file) they should run as if you hit enter within the command prompt. If you need to run the batch file as an administrator, you will have to create a shortcut to the batch file, have the shortcut set up to run as administrator, and have that be what the scheduler calls. "[R]ight-click [the shortcut] > Properties > Shortcut tab > Advanced > Run as administrator" (Running Batch File as an Administrator in Vista).
My System SpecsSystem Spec
Reply

 Creating .batch to run at shutdown





Thread Tools



Similar help and support threads for2: Creating .batch to run at shutdown
Thread Forum
Creating a batch script or use a 3rdpartyprogram to create shortcuts General Discussion
Solved Creating Batch File with Robo Copy General Discussion
Help creating a batch file to auto login to a website General Discussion
Help Needed Creating Batch File General Discussion
Help creating batch file General Discussion
Remote Shutdown advanced Batch Job Network & Sharing
Creating a welcoming batch file... Software

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 03:24 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33