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
jmh033089

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
writhziden

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
jmh033089

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
writhziden

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
Thread Forum
Creating the PPPOE internet connection using batch file
I have a PPPoE internet connetion from my ISP. Every time I want to access the internet connection I have to goto the setting and in that I have to open it and then have to dial it. This is the traditional way to log in but I wanted to make a batch file in which the PPPoE user name and password is...
Network & Sharing
Creating a batch script or use a 3rdpartyprogram to create shortcuts
Hello! I'm having trouble creating a batch script to simply copy a shortcut to the desktop from a program installation, then carry out some tasks. Overall my goals are: Burn a CD that includes a autorun.inf that will load a batch script In the script I want it to activate two self...
General Discussion
Creating Batch File with Robo Copy
Hi I am currently running the following to supposedely create a directory IE V:\Backup Folder\Pictures\Backup 21-05-2012 robocopy /e "c:\users\jon\pictures" "v:\Backup Folder\Pictures\Backup %date:~-10,2%-%date:~-7,2%-%date:~-4,4%" Evrything works fine except the backed up pictures folder is...
General Discussion
Help creating a batch file to auto login to a website
I have created the following batch file to automatically load and login to a site, I created it and tested it on a computer running xp, but I can't get it to work on a windows 7 machine... "@ECHO OFF TITLE Water Monitor Auto Start Up mode con: cols=42 lines=1 REM Create a time delay...
General Discussion
Help Needed Creating Batch File
Hi, I have 2 files that are in the same directory which I want to start one after the other. I have created a simple batch file like this which opens 2 files at the same time. Example Start Server.exe Start Game.exe
General Discussion
Creating a welcoming batch file...
I need help creating batch file that will do the following... I want it to echo "Welcome (insert name here)." I want it to say "How are you today, good or bad?" If G, I want it to display, "That's great to know, sir! Would you like me to open your homepage? If Y, I want it to execute cd...
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 23:04.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App