Batch file to execute a command in it every 1 minute

I want to create a batch file that executes a command in it every 1 minute.

how can i continue this?

what i want to do:

upload the file from somedomain.com/updates.html to a new file every 1 min. or so I donโ€™t have any .NET framework installed here, so I thought about going with batch files.

After you have worked a bit with the search http://www.chami.com/tips/windows/062598W.html

now what i want is to call 1 whic downloads command and write a new file every 1 minute.

+4
source share
4 answers

From http://malektips.com/dos0017.html

Do you need a batch file waiting for a certain number of seconds? In some languages, the command will be WAIT, but DOS and Windows will not ship with this command for batch files. If you want to implement the WAIT command:

For DOS, Windows 95, and Windows 98 computers

Create the following batch file and name it WAIT.BAT.

@ CHOICE / T: N,% 1%> NUL

Now, to wait 10 seconds in the batch file, simply call the batch file WAIT.BAT as follows:

CALL WAIT 10

For computers with Windows 95, Windows 98, Windows NT, Windows 2000, Windows XP, or Windows 2003

You can use the following WAIT.BAT, since the CHOICE command is not included in the default installation in Windows NT, Windows 2000, Windows XP, or Windows 2003:

@ping 127.0.0.1 -n 2 -w 1000> nul @ping 127.0.0.1 -n% 1% -w 1000> nul

The reason for the two lines is that in order to wait for the use of the PING command, you must add additional pings to correctly wait for the desired number of seconds. In addition, since the PING command is used, it is possible that this WAIT batch file can run for several milliseconds. Therefore, it is not recommended to use this for real-time critical processing.

Windows XP and Windows 2003

Since users of Windows XP and 2003 do not have the CHOICE command, if you find an alternative to PING that does not suit you, there is a SLEEP command in the Windows 2003 resource set command.

+1
source

I would highly recommend that you do not, and instead use a scheduled task that is scheduled to run every minute ...

Here's a guide to using scheduled tasks in XP / Server 2003.

+6
source

I recommend using Scheduled on Windows for this! Do not add a planning cycle / cycle in a batch file!

+1
source

While there was no wait command on the command line, this was a common problem, and MS issued a sleep command as part of a resource set. You can simply use the sleep.exe command in a while loop.

I have sleep.exe from the Windows 2003 Resource Kit, which can be found online .

0
source

All Articles