Hello, I would like to know how I could launch a command line that repeats itself within an interval of 60 seconds of timeout. Thanks.
daguilar01
Apr 10 2004, 09:13 PM
what do you mean by repeats itself?
vnet576
Apr 10 2004, 09:15 PM
Do u mean something like that?
while(1) { command(); Sleep(60000); }
x1`
Apr 10 2004, 09:16 PM
do you mean like site exec program.exe every 60 seconds something that will do that , automatic executer
Starlight
Apr 10 2004, 09:28 PM
yes Dickybob20
i would like to do :
site exec del.bat
sleep 60 sec
site exec del.bat
sleep 60 sec
...
is it possible ?
daguilar01
Apr 10 2004, 09:34 PM
i dont remember who it was but someone gave a very good method of a windows built in timer
ping -n x localhost x being the number of seconds you want, it is kinda accurate, works very well
CODE
:start ping -n 60 localhost ... echo this is your code goto start
this should keep it in an infinite loop
EDIT: heres an example
CODE
echo %time% ping -n 60 localhost echo %time%
gives output
QUOTE
14:38:27.10
Pinging daguilar-pc1 [127.0.0.1] with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128 ... ... ... Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Ping statistics for 127.0.0.1: Packets: Sent = 60, Received = 60, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms 14:39:26.35
as you can see, on pinging localhost 60 times, it took about 59 secs
OldSkool
Apr 10 2004, 09:34 PM
this should be very easy in c , i will make it von vb. post it later
@echo echo off :10 dir c:\ sleep 60 bla.bat goto 10
Buz
migo
Apr 10 2004, 11:18 PM
hey i know exactly wt u need
look u have to make a batch file in conjuction with external file i have everything
here is the code "
CODE
@echo off :10 dir c: TYPE NUL | sleep.exe 5 >NUL goto 10
now u need a file called sleep.exe and just place it in the same dir with the batch file
as u can see in the above example u can sleep for just 5 second then the command "dir c:" will be executed once again , increase the the amount of time as u like