There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
DOS/Other
Tag Cloud
access acer asus batch bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop lcd malware memory modem monitor motherboard network printer problem ram registry router slow software sound toshiba trojan usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless xbox
Search
Search for:
Tech Support Guy Forums > Operating Systems > DOS/Other >
Solved: bat-file to open 2 programs plus associated files

Reply  
Thread Tools
lampe73's Avatar
Computer Specs
Junior Member with 9 posts.
 
Join Date: Nov 2009
Experience: Intermediate
01-Nov-2009, 04:57 PM #1
Solved: bat-file to open 2 programs plus associated files
Hi,
on my PC xls-files are associated to excel.exe and tex.files to WinEdt.exe.
If I run the two-lines-batch-file

"C:\...\file1.xls"
"C:\...\file2.tex"

the first line acts as wanted (opens excel and file1.xls) but then the batch-file stops executing. If I deactivate the first line the second line alone acts as wanted too.

What do I have to put between line 1 and 2 so that both programs and both files are open at the end.

Must be simple but all my attempts failed.

Kind regards, lampe73
TheOutcaste's Avatar
Computer Specs
Distinguished Member with 9,048 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
02-Nov-2009, 02:14 AM #2
Welcome to TSG!

Use Start:

Code:
Start "" "C:\...\file1.xls"
Start "" "C:\...\file2.tex"
The "" is the title part of the Start command. It must be included if the command to execute is quoted or Start thinks the quoted command is the title.
lampe73's Avatar
Computer Specs
Junior Member with 9 posts.
 
Join Date: Nov 2009
Experience: Intermediate
02-Nov-2009, 04:42 AM #3
bat-file to open 2 programs plus associated files
Thank you very much, your solution works perfectly.

I searched for my question in many ms-dos-bat sources but did not succeed. Can you recommend an online manual where I would have found it? Batch-files are a valuable tool to rationalize my work.

Is it my job to mark the thread now as solved?

Kind regards, lampe73
TheOutcaste's Avatar
Computer Specs
Distinguished Member with 9,048 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
02-Nov-2009, 05:42 AM #4
Can't think of any one specific manual/location that mentions that, been a while since I've actually read any type of Guide, but it is something that barely gets mentioned.
It's just the way batch files work when you call another program, even when not using the Call statement. The batch file waits until the program is finished before continuing.

The Start command has a Wait switch so it will wait for the started application to finish, implying it won't wait if you don't use that switch. A Catch22, as you have to know about Start and that switch to realize you need it.

I've found the sites listed below to be very helpful, and the Built-in help is also very useful - Start | Help and Support, Search on Command line reference, or Command line reference A-Z
You can also type Help in a command prompt for a list of commands, then type the command followed by /? for help on specific commands.

And yes, you are the one who can Mark this Solved

DOS and VB Scripting Links:
An A-Z Index of the Windows XP command line
Command-line reference A-Z
Using batch parameters
Windows 95/98/ME Batch file Tutorial (Still a good basic reference for WinNT/2K/XP)
Batch File Functions for NT4/2000/XP/2003
Rob van der Woude's Scripting Pages
Microsoft Script Center
Beginners Guides: WindowsXP Command Prompt
Beginners Guides: Understanding and Creating Batch Files
__________________
Microsoft MVP - Windows Expert - Consumer
Of course I know all the answers ; I just don't always match the answers to the right questions

lampe73's Avatar
Computer Specs
Junior Member with 9 posts.
 
Join Date: Nov 2009
Experience: Intermediate
02-Nov-2009, 06:55 AM #5
bat-file to open 2 programs plus associated files
Thank you for your elaborate answer. You responded exactly the way an (almost) beginner can interpret. In some other forums I have met encrypters, sphinxes and oracles who like to riddle - which is not very helpful. I'd like to encourage you to continue your way.

Kind regards, lampe73
Reply

Tags
batch-file, file, open, program

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.

Search Tech Support Guy

Find the solution to your
computer problem!




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 want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
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 08:39 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.