Creating .batch to run at shutdown


  1. Posts : 2
    Windows 7 Ultimate Media Center Edition x64 SP1
       #1

    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 Computer


  2. Posts : 11,269
    Windows 7 Home Premium 64 Bit
       #2

    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 Computer


  3. Posts : 2
    Windows 7 Ultimate Media Center Edition x64 SP1
    Thread Starter
       #3

    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 Computer


  4. Posts : 11,269
    Windows 7 Home Premium 64 Bit
       #4

    jmh033089 said:
    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; 05 Feb 2012 at 11:08.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About 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 23:44.
Find Us