• 0

delay program start with bat file


Question

Is there a way i could make a bat file that would delay the running of a program to a set time?

i have a temp sensor program that starts when windows loads but it never work because the driver it uses loads after windows starts the program so i have to run in manually later. Is there a way a bat program could delay this program from starting (say 10sec) and then when it starts, the driver will have been loaded, and everything will be fine.

Thanks

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Something like this should work:

ping -n 10 127.0.0.1>nul

(that'll uselessly ping yourself for about 10 seconds)

Or change 10 to another number for number of seconds to "wait". You also can do this with sleep.exe in one of the resource kits, if you want.

Link to comment
Share on other sites

  • 0

wow, thanks, you know i read about doing that with pinging but had i just didnt put the two together

so i would make that bat like this then?

ping -n 10 127.0.0.1>nul

C:Program FilesmbprobeMBProbe.exe

Link to comment
Share on other sites

  • 0
Originally posted by username

wow, thanks, you know i read about doing that with pinging but had i just didnt put the two together

so i would make that bat like this then?

ping -n 10 127.0.0.1>nul

C:Program FilesmbprobeMBProbe.exe

Close, but this would work better:

<pre>@echo off

ping -n 10 127.0.0.1>nul

start "" "C:Program FilesmbprobeMBProbe.exe"</pre>

Note:

@echo off : silence, to speed things up

ping : waits

start : starts the program and quits instead of waiting until the program is closed to quit the batch file

Link to comment
Share on other sites

  • 0

hey, thanks so much, this is perfect, made a shortcut to the bat file, and run in minimized, works great.

I was reading up on that but have no idea where to put anything in the script or what half the stuff even means, thanks again

Link to comment
Share on other sites

  • 0

The ping delay method works great. It's one of my faves.

Much more efficient than creating a pointless loop (for /L %%t in (0,...) etc.

While were in prompt land, does anyone know a way to minimize an already running application using the DOS/NT CMD line?

Link to comment
Share on other sites

  • 0
wow, thanks
Any time ;)
The ping delay method works great. It's one of my faves.

Much more efficient than creating a pointless loop (for /L %%t in (0,...) etc.

While were in prompt land, does anyone know a way to minimize an already running application using the DOS/NT CMD line?

But FOR loops use 100% CPU :(. Sometimes I use "for /l %%i in (1,1,10000) do start" just to hurt me computer.

As for the minimize thing, you can use CMDOW, which can do alot of stuff. Haven't tested it yet, though.

http://www.commandline.co.uk/cmdow/index.html

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.