Tech Support > Microsoft Windows > bat file to run application in background
bat file to run application in background
Posted by tonybarker@yahoo.com on October 23rd, 2005


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

Posted by Squire on October 23rd, 2005


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


<tonybarker@yahoo.com> wrote in message
news:1130096678.563029.7330@f14g2000cwb.googlegrou 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
>



Posted by Detlev Dreyer on October 23rd, 2005


tonybarker@yahoo.com 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

Posted by billious on October 24th, 2005



"Detlev Dreyer" <detdreyer@flashmail.com> wrote in message
news:2222e6b6f091bbba09ef7082b1317f72@d-d.mvps.org...
> tonybarker@yahoo.com 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


Posted by Detlev Dreyer on October 24th, 2005


"billious" <billious_1954@hotmail.com> 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

Posted by Adam on January 7th, 2006


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

"tonybarker@yahoo.com" 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
>
>

Posted by billious on January 8th, 2006



"Adam" <Adam@discussions.microsoft.com> wrote in message
news:9F3A9DC8-1A47-400B-9C27-35368BC615ED@microsoft.com...
> "tonybarker@yahoo.com" 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





Similar Posts