Sign in to follow this  
Followers 0
username

delay program start with bat file

7 posts in this topic

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.