PC Help Forum - Free Computer Help, Windows, Hardware, Software and more!
 
Become a Member Today!
Search PC Help Forum for Answers
 
Go Back   PC Help Forum - Free Computer Help, Windows, Hardware, Software and more! > Computing (General) > Programming
Programming - Batch File Delay ? posted in the Computing (General) forums; I have recently just learned how to create a very basic .bat file. Basically i have 3 main programs which i want to open up after Win XP starts. I ...

REGISTER NOW to remove these Ads

Reply
 
LinkBack Thread Tools Display Modes Language
  #1  
Old 02-22-2008
andy15star's Avatar
Bronze Member
 
Posts: 3
PC Experience: Experienced
andy15star - See this Members User comments on their Profile page
Default Batch File Delay ?

I have recently just learned how to create a very basic .bat file. Basically i have 3 main programs which i want to open up after Win XP starts. I DO NOT want them to open up AS XP starts, otherwise i'd add them to the startup menu. Instead i want to be able to click on a batch file to open all 3 programs. I have written the batch file (below) and it works fine. But i now want program 2 (second line of batch file) to open up 30 seconds after the first program and the 3rd program (line 3) to open up 20 seconds after the second one.

What do i add to the lines to make this work ?

I have included the e raw text from my batch file below to see if anyone can help me place the correct text on the lines that need it to enable this delay to work :

Best Regards
Andrew

Start "" "C:\Program Files\Kinetic\BaseStation\BaseStation.exe"
Start "" "C:\Documents and Settings\Andrew\Desktop\DUMP\SBS-1\SBSPopulateDB_1.0.0.11\SBSPopulateDB_1_0_0_11.ap plication"
Start "" "C:\Documents and Settings\Andrew\Desktop\DUMP\SBS-1\flight lookup\Flight Display 6\FlightDisplay_6_0_0_0.application"

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #2  
Old 02-22-2008
Stepes's Avatar
Gold Member
My PC
 
Posts: 266
PC Experience: Experienced
Stepes - See this Members User comments on their Profile page
Default Re: Batch File Delay ?

"What you need is this:

choice /n/t:c,25/c:cc

Basically the CHOICE command is used to accept menu choices in a batch file. If the user doesn't select an option, you can have it automatically choose an option.

In this case, we don't have any options and are basically only using the timer. You can have whatever delay you want (in seconds) just change the number in the command above to whatever you need."
quoted from Put a delay in a batch job? [Archive] - WinDrivers Computer Tech Support Forums

Hehe I don't have much experience with batch files but google often helps you know

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old 02-22-2008
andy15star's Avatar
Bronze Member
 
Posts: 3
PC Experience: Experienced
andy15star - See this Members User comments on their Profile page
Default Re: Batch File Delay ?

Hi, and thanks for the quick reply, but that doesn't seem to work, they all still open up at the same time !. I'm pretty new to all this, so is this what you mean ?

Start "" "C:\Program Files\Kinetic\BaseStation\BaseStation.exe"
choice /n/30:c,25/c:cc
Start "" "C:\Documents and Settings\Andrew\Desktop\DUMP\SBS-1\SBSPopulateDB_1.0.0.11\SBSPopulateDB_1_0_0_11.ap plication"
choice /n/30:c,25/c:cc
Start "" "C:\Documents and Settings\Andrew\Desktop\DUMP\SBS-1\flight lookup\Flight Display 6\FlightDisplay_6_0_0_0.application"

Regards, Andrew

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #4  
Old 02-22-2008
Stepes's Avatar
Gold Member
My PC
 
Posts: 266
PC Experience: Experienced
Stepes - See this Members User comments on their Profile page
Default Re: Batch File Delay ?

maybe this? TYPE NUL | CHOICE.COM /N /CY /TY,20 >NUL

But to tell you the truth I've no idea from batch files. I just thought the link would work :P

Edit: Oh d@mn choice doesn't exist in win xp anymore :/ you can copy it from win 98 but I guess you should search for a different solution. I'm no forum tech support anyways :P

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #5  
Old 02-22-2008
andy15star's Avatar
Bronze Member
 
Posts: 3
PC Experience: Experienced
andy15star - See this Members User comments on their Profile page
Default Re: Batch File Delay ?

hi, well i seem to have done what i wanted using a program called "batchrun" !. It seems to work for this purpose although i'm still curious as to how to get it to work from a user created batch file without using a software related program !

Best Regards,
Andrew

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #6  
Old 02-29-2008
dahli's Avatar
Senior Security Analyst
 
Posts: 545
PC Experience: Experienced
Location: In a van, down by the river
dahli - See this Members User comments on their Profile page dahli - See this Members User comments on their Profile page dahli - See this Members User comments on their Profile page
Default Re: Batch File Delay ?

Hello,

If the computers are connected to a network, you could use the ping command.

example:

start program1
ping 1.1.1.1 -n 3 -w 1000 > nul
start program2
ping 1.1.1.1 -n 6 -w 1000 > nul
start program3

n=number of times ping will retry to communicate with the IP address
w=number of milliseconds between the retries

So you can adjust either number as you see fit to get the delay time you are looking for.

__________________
Steve
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply


Go Back   PC Help Forum - Free Computer Help, Windows, Hardware, Software and more! > Computing (General) > Programming




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
File Extensions List Hengis Windows Tutorials 0 02-09-2008 03:27 PM
can some one take a look g2064 Windows XP/2000 1 05-27-2007 04:27 AM
[Resolved] HELP Plz!!! Add/Remove Programs CrazyKate [Fixed] Hijackthis! Logs 20 12-21-2006 02:34 PM
Broadband internet going off and online ajspurs Internet Help 7 05-05-2006 01:12 AM
[Answered] Virus Infected Windows 2000 Server anteaus [Fixed] Hijackthis! Logs 6 08-09-2005 01:20 AM


All times are GMT +1. The time now is 09:55 PM.