PDA

View Full Version : bat file to run application in background


October 23rd 05, 08:44 PM
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

Squire
October 23rd 05, 09:45 PM
It's been a while since I used bat files, but if I recall,

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


--

Politicians and Diapers must be changed
often and for the very same reason


> wrote in message
ps.com...
>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
>

Detlev Dreyer
October 23rd 05, 10:44 PM
wrote:

> 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.

--
d-d

billious
October 24th 05, 03:19 AM
"Detlev Dreyer" > wrote in message
...
> wrote:
>
>> 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.
>
> --
> d-d

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

Detlev Dreyer
October 24th 05, 06:12 AM
"billious" > wrote:

> 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.

--
d-d

Adam
January 7th 06, 07:45 PM
After the start command line put a /min switch. This will start the program
minimized.

" wrote:

> 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
>
>

billious
January 8th 06, 04:00 AM
"Adam" > wrote in message
...
> " wrote:
>
>> 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
>>

> 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

Google