# Solved: bat-file to open 2 programs plus associated files



## lampe73 (Nov 1, 2009)

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 (Aug 8, 2007)

Welcome to TSG!

Use Start:


```
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 (Nov 1, 2009)

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 (Aug 8, 2007)

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


----------



## lampe73 (Nov 1, 2009)

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


----------

