bat file to run application in background

T

tonybarker

I am writing a simple .bat file which is run from
a DOS window to take some arguments, create a PDF
file and then open the resulting pdf file with
Acrobat Reader.

This all works well except that Acrobat Reader ties up
the DOS window. That is, I cannot run any more commands
until Acrobat Reader is closed. If I were doing this in
Unix, I could simply add an "&" at the end of the Acrobat
Reader call, which would open the Acrobat Reader as a
background process, thereby keeping my commandline open.
Does DOS have something similar?

Thanks,
Tony
 
S

Squire

It's been a while since I used bat files, but if I recall,

As the last line in your bat file, type END.
 
D

Detlev Dreyer

This all works well except that Acrobat Reader ties up
the DOS window. That is, I cannot run any more commands
until Acrobat Reader is closed.

Type 'start' at the beginning of that batch command line.
 
B

billious

Detlev Dreyer said:
Type 'start' at the beginning of that batch command line.

just one little potential problem with START. Under XP, the first quoted
command-parameter may be taken as the title.

START/? from the prompt should guide you -

START whatever.pdf
START "" whatever.pdf
START "" "path\to\acrobat" whatever.pdf
should all work

START "path\to\acrobat" whatever.pdf
is where you may encounter a problem.

HTH

....Bill
 
D

Detlev Dreyer

billious said:
START "path\to\acrobat" whatever.pdf
is where you may encounter a problem.

That's why I recommend to use short (8.3) path- and filenames only
within a batch file. This works under all Windows versions while
long names with quotes may fail in some cases.
 
G

Guest

After the start command line put a /min switch. This will start the program
minimized.
 
B

billious

After the start command line put a /min switch. This will start the
program
minimized.

I gain the impression that the OP's batch reads

somepdf.pdf
or
"C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe" somepdf.pdf

and the required line should be

START "some title text" "C:\Program Files\Adobe\Acrobat
7.0\Reader\AcroRd32.exe" somepdf.pdf
or
START "some title text" somepdf.pdf

where the addition of the /min switch will minimise the window created.

The key is START (see START/? from the prompt) which will open the Acrobat
Reader window, then continue the batch with the Acrobat window open.

HTH

....Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top