There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
bios black screen boot computer connection crash css dell display driver drivers email error excel firefox firefox 3 freeze game hard drive internet internet explorer itunes laptop lcd linux malware monitor network networking nvidia outlook outlook 2003 outlook express partition password printer problem router slow sound sprtcmd.exe startup trojan usb video virus vista windows windows xp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
batch file halts and not continue


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
diodepump's Avatar
Junior Member with 3 posts.
 
Join Date: Aug 2007
Experience: Intermediate
05-Aug-2007, 03:12 PM #1
batch file halts and not continue
Hi
I want to create a batch file that starts one win2000 app then wait 20 secs and start another win2000 app.
My prob is that the first app requires a prompt to continue and i want the batch file to ignore the prompt and start the timer of 20 secs and then run the second app
e.g.
echo off

"C:\Program Files\start app A"

ping -n 22 127.0.0.1 >nul : wait 20 secs
C:\start prog B
Squashman's Avatar
Distinguished Member with 12,699 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
05-Aug-2007, 04:56 PM #2
Your syntax for using start is wrong.

start "C:\Program Files\Directory\Program.exe"

You may want to look into using AutoIT.
http://www.autoitscript.com/autoit3/
diodepump's Avatar
Junior Member with 3 posts.
 
Join Date: Aug 2007
Experience: Intermediate
05-Aug-2007, 05:56 PM #3
Hi
I tried using..... start "C:\Program Files\Directory\Program.exe"
All it did is open a dos box with a title of ....C:\Program Files\Directory\Program.exe
Any ideas?
thanx
Squashman's Avatar
Distinguished Member with 12,699 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
06-Aug-2007, 09:21 PM #4
Can you show us the actual batch file.
desmin's Avatar
Account Disabled with 61 posts.
 
Join Date: Jul 2007
Experience: COMPUTER MASTER
07-Aug-2007, 09:43 PM #5
dont ping to 127.0.0.1 i dont remember but i think i use 0.0.0.0
try that
Mosaic1's Avatar
Distinguished Member with 7,502 posts.
 
Join Date: Aug 2001
09-Aug-2007, 01:24 PM #6
Here's an example of starting solitaire and then notepad.

Pinging address is loopback either way and makes no difference. The ping is used as a delay tactic.


start sol.exe && ping -n 20 127.0.0.1 >nul && start Notepad.exe

What this does is it starts solitaire. And once sol is started successfully, the ping delay starts. Once the ping has successfully executed, then notepad is started.

The double ampersands are there for that reason. You can string commands together. Using this technique, the next command will not execute unless the previous has been successfully executed.

See if this helps. But if the first app requires user intervention to continue, that first app is not going to function correctly once started. If this doesn't work, you'll have to look into using some other method to send a message to app1.
Mosaic1's Avatar
Distinguished Member with 7,502 posts.
 
Join Date: Aug 2001
09-Aug-2007, 01:36 PM #7
If you use || instead of the &&, then the next command runs if the first is not successful.

However, the fact that he first app waits for user intervention may be problem. And as mentioned above, you'll have to resolve that issue more than likely if that's the case.
goldhat's Avatar
Member with 70 posts.
 
Join Date: Aug 2007
Experience: kinda good kinda not
13-Aug-2007, 10:34 AM #8
try this it works for me PING 1.1.1.1 -n 1 -w 20000 >NUL
diodepump's Avatar
Junior Member with 3 posts.
 
Join Date: Aug 2007
Experience: Intermediate
22-Aug-2007, 09:23 AM #9
hello all
i got it to work with START command without the quote marks but i had to run the batch file command from the directory in which the prog.exe resides.
The reason for using the START command was because the first prog starts and prompts for confirmation before continuing therefore the second prog will never start unless the prompt is accepted first.I wanted the batch file to ignore this prompt and continue .
Thank you all for your help
Squashman's Avatar
Distinguished Member with 12,699 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
23-Aug-2007, 07:00 PM #10
Like I said, if you would have just posted your original batch file we could have resolved it alot easier. It was most likely a syntax problem. You don't have to run the batch file from the directory where the program resides if you use the full path.

We can only help people if you provide all the information we need to give you the proper solution.
__________________
I hate asking the same question twice!
How to ask questions the smart way!
Microsoft MVP - Windows Shell/User
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 01:04 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.