Windows 7 Forums Search
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows 7. The Windows 7 forum also covers news and updates and has an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7 - Creating .batch to run at shutdown

 
01-15-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
01-15-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
01-15-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
.


01-15-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).

Last edited by writhziden; 02-05-2012 at 11:08 AM..
My System SpecsSystem Spec
Reply

 Creating .batch to run at shutdown problems?



Thread Tools



Similar Threads for: Creating .batch to run at shutdown
Thread Forum
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


All times are GMT -5. The time now is 07:52 PM.



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
  

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