Mourning the loss of our friend, WhitPhil.
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
DOS/PDA/Other
Tag Cloud
access audio blue screen boot bsod connection crash dell desktop driver dvd email error excel excel 2003 firefox hard drive hardware hdmi hijackthis internet keyboard laptop malware monitor motherboard network networking outlook problem ram recovery router screen slow sound spyware tdlwsp.dll trojan upgrade vba video virus vista vundo windows windows 7 windows vista windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > DOS/PDA/Other >
Solved: bat-file to open 2 programs plus associated files

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

 
Thread Tools
lampe73's Avatar
Computer Specs
Junior Member with 7 posts.
 
Join Date: Nov 2009
Experience: Intermediate
01-Nov-2009, 03: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 5,485 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
02-Nov-2009, 01: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 7 posts.
 
Join Date: Nov 2009
Experience: Intermediate
02-Nov-2009, 03: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 5,485 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
02-Nov-2009, 04: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 Desktop Experience
Of course I know all the answers ; I just don't always match the answers to the right questions
Are you aware of the New Signature Limitations?
lampe73's Avatar
Computer Specs
Junior Member with 7 posts.
 
Join Date: Nov 2009
Experience: Intermediate
02-Nov-2009, 05: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 Bookmark and Share

Tags
batch-file, file, open, program

Smart Search

Find your solution!



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


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 04:40 AM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.
Powered by Cermak Technologies, Inc.