Question Locked

AutoRuning a NIC disconnect script

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I'm sure this is a simple question but when things are too simple it is tough to find an answer. My network connection somethings diconnects and the only way to fix it is to repair the network connection. I wanted to automate this and I found this script/bat file:
https://www.techrepublic.com.com/5208-6230-0.html?forumID=101&threadID=211076&messageID=2169996

It works awesome but how do I make it run in the background every say 120seconds so when I come back my connection will always be working?
I'm using windows XP pro SP3.

3 replies

by jruby

Use something like

schtasks /create /sc minute /mo 2 /tn ResetNic /TR c:\ResetMyNic.cmd

after putting your reset commands in C:\ResetMyNic.cmd

You may need to put credentials of some sort into the schtasks parameters depending on your environment.

Alternatively, if you don't want to use the scheduler and don't mind having it run in a window on your desktop, you can just code it all into a cmd file, just put the following two lines at the bottom:

sleep 120
%0 %*

SLEEP is available in almost every windows resource kit, check the MS web site if you don't have a copy.

Jim

/* If you think the problem is bad now, wait until I fix it! */

by atroposfate

That works well but is there anyway to get the schtasks to run in the background?

After some looking I got it add /RU System

Thanks for the help

This discussion is closed to new replies.