Starlight
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. smile.gif
daguilar01
what do you mean by repeats itself?
vnet576
Do u mean something like that?

while(1)
{
command();
Sleep(60000);
}
x1`
do you mean like site exec program.exe
every 60 seconds
something that will do that , automatic executer
Starlight
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
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
this should be very easy in c , i will make it von vb. post it later
riotz
bla.bat
------- starting here-------------
dir c:\
sleep 60
bla.bat
--------cut here--------------
buzzons
if u want to make it loop then add it .. like

@echo
echo off
:10
dir c:\
sleep 60
bla.bat
goto 10

Buz

migo
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

download sleep.exe from here
Sleep.exe

hope this help

Best Regards
migo
migo
here is also a very good website in creating batch file

http://www.computerhope.com/batch.htm

Starlight
thanks a lot wink.gif
it's wath i looked for smile.gif
tmm
If you want it in an exe use this:


#include <stdlib.h>
#include <windows.h>

void main()
{
while(1)
{
system("c:\\something.exe");
Sleep(10000);
}
}



just don't forget to put \\ instead of \ in the path.
bonarez
here's another kind of delay you can use in a batch, this on uses choice.com

TYPE NUL | CHOICE.COM /N /CY /TY,5 >NUL


ah, good old dos (wel not really, but batch is just as fun)
migo
no problem dude u welcome smile.gif

for the above post
if u wanna make choice.com ur own

use this ASM code, use the below code with debug command:

CODE

N CHOICE.COM
A 100
MOV SI,0082
MOV AX,[SI]
XCHG AH,AL
XOR AX,3030
MOV BL,AL
MOV AL,0A
MUL AH
ADD AX,BX
MOV SI,AX
MOV AH,2C
INT 21
MOV BL,DH
MOV AX,SI
AAM
OR AX,3030
XCHG AH,AL
MOV [0160],AX
MOV AH,09
MOV DX,0160
INT 21
MOV AH,06
MOV DL,FF
INT 21
JZ 014C
OR AL,AL
JNZ 013F
MOV AH,08
INT 21
MOV AL,FF
MOV DX,016C
PUSH AX
MOV AH,09
INT 21
POP AX
MOV AH,4C
INT 21
MOV AH,2C
INT 21
CMP BL,DH
JZ 012D
MOV BL,DH
DEC SI
JNZ 011A
SUB AL,AL
MOV DX,016C
JMP 0142
DB "XX SECONDS", D, 24
DB " ", D, A, 24

RCX
79
W
Q
riotz
QUOTE (migo @ Apr 11 2004, 07:24 PM)
no problem dude u welcome smile.gif

for the above post
if u wanna make choice.com ur own

use this ASM code, use the below code with debug command:

CODE

N CHOICE.COM
A 100
MOV SI,0082
MOV AX,[SI]
XCHG AH,AL
XOR AX,3030
MOV BL,AL
MOV AL,0A
MUL AH
ADD AX,BX
MOV SI,AX
MOV AH,2C
INT 21
MOV BL,DH
MOV AX,SI
AAM
OR AX,3030
XCHG AH,AL
MOV [0160],AX
MOV AH,09
MOV DX,0160
INT 21
MOV AH,06
MOV DL,FF
INT 21
JZ 014C
OR AL,AL
JNZ 013F
MOV AH,08
INT 21
MOV AL,FF
MOV DX,016C
PUSH AX
MOV AH,09
INT 21
POP AX
MOV AH,4C
INT 21
MOV AH,2C
INT 21
CMP BL,DH
JZ 012D
MOV BL,DH
DEC SI
JNZ 011A
SUB AL,AL
MOV DX,016C
JMP 0142
DB "XX SECONDS", D, 24
DB " ", D, A, 24

RCX
79
W
Q

wow great one
thank you!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.

 
Invision Power Board © 2001-2005 Invision Power Services, Inc.