Technology Questions

Go Back   Technology Questions > Software Questions > Operating System Questions > Windows XP

Windows XP Discuss the Microsoft Windows XP Operating System



Reply
 
LinkBack Thread Tools
  #1  
Old 06-30-2009, 04:50 PM
Lushington
Newsgroup Contributor
 
Posts: n/a
Batch File Questions

It's been a long time since I've done any batch programming and I need my
memory refreshed.

If I start two applications in sequence

@echo off
"C:\Program Files\My Application\My Program" /parameters
"C:\Program Files\Another App\Another Program" /parameters

Does the first program have to complete before the second one starts (which
is what I want)? Or do I have to be a little fancier?

A Command Prompt window opens when the batch file is executed. Is there a
way to close the Command Prompt window before the programs complete?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

 
Old 06-30-2009, 04:50 PM
  #2  
Old 06-30-2009, 05:10 PM
Kelly
Newsgroup Contributor
 
Posts: n/a
Re: Batch File Questions

Using Batch Files:
http://www.microsoft.com/resources/d....mspx?mfr=true

--

All the Best,
Kelly (MS-MVP/DTS&XP)

Taskbar Repair Tool Plus!
http://www.kellys-korner-xp.com/taskbarplus!.htm


"Lushington" <Lushington@discussions.microsoft.com> wrote in message
news:E4484895-A1D2-4FA2-9CF7-31E0DAA75EED@microsoft.com...
> It's been a long time since I've done any batch programming and I need my
> memory refreshed.
>
> If I start two applications in sequence
>
> @echo off
> "C:\Program Files\My Application\My Program" /parameters
> "C:\Program Files\Another App\Another Program" /parameters
>
> Does the first program have to complete before the second one starts
> (which
> is what I want)? Or do I have to be a little fancier?
>
> A Command Prompt window opens when the batch file is executed. Is there a
> way to close the Command Prompt window before the programs complete?


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #3  
Old 06-30-2009, 05:30 PM
Newsgroup Contributor
 
Posts: n/a
Re: Batch File Questions

start "" /w Program1
start "" /w Program2

start /? for help
--
..
--
"Lushington" <Lushington@discussions.microsoft.com> wrote in message
news:E4484895-A1D2-4FA2-9CF7-31E0DAA75EED@microsoft.com...
> It's been a long time since I've done any batch programming and I need my
> memory refreshed.
>
> If I start two applications in sequence
>
> @echo off
> "C:\Program Files\My Application\My Program" /parameters
> "C:\Program Files\Another App\Another Program" /parameters
>
> Does the first program have to complete before the second one starts
> (which
> is what I want)? Or do I have to be a little fancier?
>
> A Command Prompt window opens when the batch file is executed. Is there a
> way to close the Command Prompt window before the programs complete?


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #4  
Old 06-30-2009, 05:30 PM
Tim Meddick
Newsgroup Contributor
 
Posts: n/a
Re: Batch File Questions

Almost right, but use the "start" command to start the programs using
the "/w" (wait) switch if you really need the first program to finish
before starting the second, thus....

@echo off
start /w "C:\Program Files\My Application\My Program" /parameters
start /w "C:\Program Files\Another App\Another Program" /parameters


==

Cheers, Tim Meddick, Peckham, London. :-)




"Lushington" <Lushington@discussions.microsoft.com> wrote in message
news:E4484895-A1D2-4FA2-9CF7-31E0DAA75EED@microsoft.com...
> It's been a long time since I've done any batch programming and I need
> my
> memory refreshed.
>
> If I start two applications in sequence
>
> @echo off
> "C:\Program Files\My Application\My Program" /parameters
> "C:\Program Files\Another App\Another Program" /parameters
>
> Does the first program have to complete before the second one starts
> (which
> is what I want)? Or do I have to be a little fancier?
>
> A Command Prompt window opens when the batch file is executed. Is
> there a
> way to close the Command Prompt window before the programs complete?



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #5  
Old 06-30-2009, 05:50 PM
Lushington
Newsgroup Contributor
 
Posts: n/a
Re: Batch File Questions

Thanks (and to Tim Meddick too). The help file just has /wait rather than /w
but that's a small point.

And I think if I use the /B parameter, it won't open a Command Prompt
window, either.

"." wrote:

> start "" /w Program1
> start "" /w Program2
>
> start /? for help
> --
> ..
> --
> "Lushington" <Lushington@discussions.microsoft.com> wrote in message
> news:E4484895-A1D2-4FA2-9CF7-31E0DAA75EED@microsoft.com...
> > It's been a long time since I've done any batch programming and I need my
> > memory refreshed.
> >
> > If I start two applications in sequence
> >
> > @echo off
> > "C:\Program Files\My Application\My Program" /parameters
> > "C:\Program Files\Another App\Another Program" /parameters
> >
> > Does the first program have to complete before the second one starts
> > (which
> > is what I want)? Or do I have to be a little fancier?
> >
> > A Command Prompt window opens when the batch file is executed. Is there a
> > way to close the Command Prompt window before the programs complete?

>
>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #6  
Old 06-30-2009, 06:00 PM
Tim Meddick
Newsgroup Contributor
 
Posts: n/a
Re: Batch File Questions

I use the "/b" switch always (just to be on the safe side) but I think
that it really only applies to 'Command-line' tools and Win16 DOS apps.

==

Cheers, Tim Meddick, Peckham, London. :-)




"Lushington" <Lushington@discussions.microsoft.com> wrote in message
news:F3E0269E-7342-44AB-B2E0-6D952775C3CF@microsoft.com...
> Thanks (and to Tim Meddick too). The help file just has /wait rather
> than /w
> but that's a small point.
>
> And I think if I use the /B parameter, it won't open a Command Prompt
> window, either.
>
> "." wrote:
>
>> start "" /w Program1
>> start "" /w Program2
>>
>> start /? for help
>> --
>> ..
>> --
>> "Lushington" <Lushington@discussions.microsoft.com> wrote in message
>> news:E4484895-A1D2-4FA2-9CF7-31E0DAA75EED@microsoft.com...
>> > It's been a long time since I've done any batch programming and I
>> > need my
>> > memory refreshed.
>> >
>> > If I start two applications in sequence
>> >
>> > @echo off
>> > "C:\Program Files\My Application\My Program" /parameters
>> > "C:\Program Files\Another App\Another Program" /parameters
>> >
>> > Does the first program have to complete before the second one
>> > starts
>> > (which
>> > is what I want)? Or do I have to be a little fancier?
>> >
>> > A Command Prompt window opens when the batch file is executed. Is
>> > there a
>> > way to close the Command Prompt window before the programs
>> > complete?

>>
>>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #7  
Old 06-30-2009, 06:10 PM
Lushington
Newsgroup Contributor
 
Posts: n/a
Re: Batch File Questions

Interestingly, another parameter for start is "title" which "Specifies the
title to display in Command Prompt window title bar." Even though this
parameter is supposedly optional, it seems that if the filename for the app
to be executed is enclosed in double quotes (as in my example, because of the
spaces in the path), then the start command uses the filename as the title,
doesn't find anything to execute, and completes without doing anything.

I had to use this syntax to get it to work:

start "mytitle" /wait "C:\Program Files\My Application\My Program" /parameters

and you're right, /B or no /B didn't seem to make a difference.

Start command syntax:
http://technet.microsoft.com/en-us/l.../bb491005.aspx

"Tim Meddick" wrote:

> I use the "/b" switch always (just to be on the safe side) but I think
> that it really only applies to 'Command-line' tools and Win16 DOS apps.
>
> ==
>
> Cheers, Tim Meddick, Peckham, London. :-)
>
>
>
>
> "Lushington" <Lushington@discussions.microsoft.com> wrote in message
> news:F3E0269E-7342-44AB-B2E0-6D952775C3CF@microsoft.com...
> > Thanks (and to Tim Meddick too). The help file just has /wait rather
> > than /w
> > but that's a small point.
> >
> > And I think if I use the /B parameter, it won't open a Command Prompt
> > window, either.
> >
> > "." wrote:
> >
> >> start "" /w Program1
> >> start "" /w Program2
> >>
> >> start /? for help
> >> --
> >> ..
> >> --
> >> "Lushington" <Lushington@discussions.microsoft.com> wrote in message
> >> news:E4484895-A1D2-4FA2-9CF7-31E0DAA75EED@microsoft.com...
> >> > It's been a long time since I've done any batch programming and I
> >> > need my
> >> > memory refreshed.
> >> >
> >> > If I start two applications in sequence
> >> >
> >> > @echo off
> >> > "C:\Program Files\My Application\My Program" /parameters
> >> > "C:\Program Files\Another App\Another Program" /parameters
> >> >
> >> > Does the first program have to complete before the second one
> >> > starts
> >> > (which
> >> > is what I want)? Or do I have to be a little fancier?
> >> >
> >> > A Command Prompt window opens when the batch file is executed. Is
> >> > there a
> >> > way to close the Command Prompt window before the programs
> >> > complete?
> >>
> >>

>
>
>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #8  
Old 06-30-2009, 06:30 PM
Tim Meddick
Newsgroup Contributor
 
Posts: n/a
Re: Batch File Questions

It's probably simpler to use the "TITLE" command in a batch file to set
the title, thusly :



@echo off
title My Program
start /w /b "C:\Program Files\My Application\My Program" /parameters



.....please note - there's no need for "quotes" after the 'title'
command.


==

Cheers, Tim Meddick, Peckham, London. :-)




"Lushington" <Lushington@discussions.microsoft.com> wrote in message
news:44BE1C72-2178-4163-A571-00A1D7A4B4AF@microsoft.com...
> Interestingly, another parameter for start is "title" which "Specifies
> the
> title to display in Command Prompt window title bar." Even though this
> parameter is supposedly optional, it seems that if the filename for
> the app
> to be executed is enclosed in double quotes (as in my example, because
> of the
> spaces in the path), then the start command uses the filename as the
> title,
> doesn't find anything to execute, and completes without doing
> anything.
>
> I had to use this syntax to get it to work:
>
> start "mytitle" /wait "C:\Program Files\My Application\My Program"
> /parameters
>
> and you're right, /B or no /B didn't seem to make a difference.
>
> Start command syntax:
> http://technet.microsoft.com/en-us/l.../bb491005.aspx
>
> "Tim Meddick" wrote:
>
>> I use the "/b" switch always (just to be on the safe side) but I
>> think
>> that it really only applies to 'Command-line' tools and Win16 DOS
>> apps.
>>
>> ==
>>
>> Cheers, Tim Meddick, Peckham, London. :-)
>>
>>
>>
>>
>> "Lushington" <Lushington@discussions.microsoft.com> wrote in message
>> news:F3E0269E-7342-44AB-B2E0-6D952775C3CF@microsoft.com...
>> > Thanks (and to Tim Meddick too). The help file just has /wait
>> > rather
>> > than /w
>> > but that's a small point.
>> >
>> > And I think if I use the /B parameter, it won't open a Command
>> > Prompt
>> > window, either.
>> >
>> > "." wrote:
>> >
>> >> start "" /w Program1
>> >> start "" /w Program2
>> >>
>> >> start /? for help
>> >> --
>> >> ..
>> >> --
>> >> "Lushington" <Lushington@discussions.microsoft.com> wrote in
>> >> message
>> >> news:E4484895-A1D2-4FA2-9CF7-31E0DAA75EED@microsoft.com...
>> >> > It's been a long time since I've done any batch programming and
>> >> > I
>> >> > need my
>> >> > memory refreshed.
>> >> >
>> >> > If I start two applications in sequence
>> >> >
>> >> > @echo off
>> >> > "C:\Program Files\My Application\My Program" /parameters
>> >> > "C:\Program Files\Another App\Another Program" /parameters
>> >> >
>> >> > Does the first program have to complete before the second one
>> >> > starts
>> >> > (which
>> >> > is what I want)? Or do I have to be a little fancier?
>> >> >
>> >> > A Command Prompt window opens when the batch file is executed.
>> >> > Is
>> >> > there a
>> >> > way to close the Command Prompt window before the programs
>> >> > complete?
>> >>
>> >>

>>
>>
>>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #9  
Old 06-30-2009, 07:40 PM
Newsgroup Contributor
 
Posts: n/a
Re: Batch File Questions

If putting the program in quotes you have to specify a title because the
first set of quotes is taken as the title.

--
..
--
"Tim Meddick" <timmeddick@gawab.com> wrote in message
news:u492Oqe%23JHA.3768@TK2MSFTNGP04.phx.gbl...
> It's probably simpler to use the "TITLE" command in a batch file to set
> the title, thusly :
>
>
>
> @echo off
> title My Program
> start /w /b "C:\Program Files\My Application\My Program" /parameters
>
>
>
> ....please note - there's no need for "quotes" after the 'title' command.
>
>
> ==
>
> Cheers, Tim Meddick, Peckham, London. :-)
>
>
>
>
> "Lushington" <Lushington@discussions.microsoft.com> wrote in message
> news:44BE1C72-2178-4163-A571-00A1D7A4B4AF@microsoft.com...
>> Interestingly, another parameter for start is "title" which "Specifies
>> the
>> title to display in Command Prompt window title bar." Even though this
>> parameter is supposedly optional, it seems that if the filename for the
>> app
>> to be executed is enclosed in double quotes (as in my example, because of
>> the
>> spaces in the path), then the start command uses the filename as the
>> title,
>> doesn't find anything to execute, and completes without doing anything.
>>
>> I had to use this syntax to get it to work:
>>
>> start "mytitle" /wait "C:\Program Files\My Application\My Program"
>> /parameters
>>
>> and you're right, /B or no /B didn't seem to make a difference.
>>
>> Start command syntax:
>> http://technet.microsoft.com/en-us/l.../bb491005.aspx
>>
>> "Tim Meddick" wrote:
>>
>>> I use the "/b" switch always (just to be on the safe side) but I think
>>> that it really only applies to 'Command-line' tools and Win16 DOS apps.
>>>
>>> ==
>>>
>>> Cheers, Tim Meddick, Peckham, London. :-)
>>>
>>>
>>>
>>>
>>> "Lushington" <Lushington@discussions.microsoft.com> wrote in message
>>> news:F3E0269E-7342-44AB-B2E0-6D952775C3CF@microsoft.com...
>>> > Thanks (and to Tim Meddick too). The help file just has /wait rather
>>> > than /w
>>> > but that's a small point.
>>> >
>>> > And I think if I use the /B parameter, it won't open a Command Prompt
>>> > window, either.
>>> >
>>> > "." wrote:
>>> >
>>> >> start "" /w Program1
>>> >> start "" /w Program2
>>> >>
>>> >> start /? for help
>>> >> --
>>> >> ..
>>> >> --
>>> >> "Lushington" <Lushington@discussions.microsoft.com> wrote in message
>>> >> news:E4484895-A1D2-4FA2-9CF7-31E0DAA75EED@microsoft.com...
>>> >> > It's been a long time since I've done any batch programming and I
>>> >> > need my
>>> >> > memory refreshed.
>>> >> >
>>> >> > If I start two applications in sequence
>>> >> >
>>> >> > @echo off
>>> >> > "C:\Program Files\My Application\My Program" /parameters
>>> >> > "C:\Program Files\Another App\Another Program" /parameters
>>> >> >
>>> >> > Does the first program have to complete before the second one
>>> >> > starts
>>> >> > (which
>>> >> > is what I want)? Or do I have to be a little fancier?
>>> >> >
>>> >> > A Command Prompt window opens when the batch file is executed. Is
>>> >> > there a
>>> >> > way to close the Command Prompt window before the programs
>>> >> > complete?
>>> >>
>>> >>
>>>
>>>
>>>

>
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #10  
Old 06-30-2009, 07:50 PM
Terry R.
Newsgroup Contributor
 
Posts: n/a
Re: Batch File Questions

The date and time was Tuesday, June 30, 2009 7:33:59 PM, and on a whim,
pounded out on the keyboard:

> If putting the program in quotes you have to specify a title because the
> first set of quotes is taken as the title.
>


You don't have to "specify" a title. Just add an extra set of quotes.
start "" /wait "C:\Program Files\My Application\My Program" /parameters


Terry R.
--
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #11  
Old 06-30-2009, 08:00 PM
Terry R.
Newsgroup Contributor
 
Posts: n/a
Re: Batch File Questions

The date and time was Tuesday, June 30, 2009 6:23:24 PM, and on a whim,
Tim Meddick pounded out on the keyboard:

> It's probably simpler to use the "TITLE" command in a batch file to set
> the title, thusly :
>
>
>
> @echo off
> title My Program
> start /w /b "C:\Program Files\My Application\My Program" /parameters
>
>
>
> ....please note - there's no need for "quotes" after the 'title'
> command.
>
>
> ==
>
> Cheers, Tim Meddick, Peckham, London. :-)
>


>
>


Tim,

You have to add the title quotes, even if they are dummies:
start "" /w /b "C:\Program Files\My Application\My Program" /parameters

otherwise what is between the quotes is interpreted as the title.

Terry R.
--
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #12  
Old 06-30-2009, 08:00 PM
Newsgroup Contributor
 
Posts: n/a
Re: Batch File Questions

Tim's example wom't work. You'll see in my post I use a blank title.

--
..
--
"Terry R." <F1Com@NOSPAMpobox.com> wrote in message
news:uqbrBaf%23JHA.4984@TK2MSFTNGP05.phx.gbl...
> The date and time was Tuesday, June 30, 2009 7:33:59 PM, and on a whim,
> pounded out on the keyboard:
>
>> If putting the program in quotes you have to specify a title because the
>> first set of quotes is taken as the title.
>>

>
> You don't have to "specify" a title. Just add an extra set of quotes.
> start "" /wait "C:\Program Files\My Application\My Program" /parameters
>
>
> Terry R.
> --
> Anti-spam measures are included in my email address.
> Delete NOSPAM from the email address after clicking Reply.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #13  
Old 07-01-2009, 07:10 AM
Terry R.
Newsgroup Contributor
 
Posts: n/a
Re: Batch File Questions

The date and time was Tuesday, June 30, 2009 7:54:31 PM, and on a whim,
pounded out on the keyboard:

> Tim's example wom't work. You'll see in my post I use a blank title.
>


Yes, I've learned from experience... ;-)


Terry R.
--
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #14  
Old 07-01-2009, 07:10 AM
ju.c
Newsgroup Contributor
 
Posts: n/a
Re: Batch File Questions

To hide the command window use this:

Hidden Start 22 KB (Freeware)
Web: http://www.ntwind.com/software/utilities/hstart.html
Download: http://www.ntwind.com/download/hstart.zip

To close the command window, add this to the end of your batch file:

CLS
EXIT


ju.c


"Lushington" <Lushington@discussions.microsoft.com> wrote in message news:E4484895-A1D2-4FA2-9CF7-31E0DAA75EED@microsoft.com...
> It's been a long time since I've done any batch programming and I need my
> memory refreshed.
>
> If I start two applications in sequence
>
> @echo off
> "C:\Program Files\My Application\My Program" /parameters
> "C:\Program Files\Another App\Another Program" /parameters
>
> Does the first program have to complete before the second one starts (which
> is what I want)? Or do I have to be a little fancier?
>
> A Command Prompt window opens when the batch file is executed. Is there a
> way to close the Command Prompt window before the programs complete?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #15  
Old 07-01-2009, 07:20 AM
Lushington
Newsgroup Contributor
 
Posts: n/a
Re: Batch File Questions

Exactly. Thanks again.

"." wrote:

> Tim's example wom't work. You'll see in my post I use a blank title.
>
> --
> ..
> --
> "Terry R." <F1Com@NOSPAMpobox.com> wrote in message
> news:uqbrBaf%23JHA.4984@TK2MSFTNGP05.phx.gbl...
> > The date and time was Tuesday, June 30, 2009 7:33:59 PM, and on a whim,
> > pounded out on the keyboard:
> >
> >> If putting the program in quotes you have to specify a title because the
> >> first set of quotes is taken as the title.
> >>

> >
> > You don't have to "specify" a title. Just add an extra set of quotes.
> > start "" /wait "C:\Program Files\My Application\My Program" /parameters
> >
> >
> > Terry R.
> > --
> > Anti-spam measures are included in my email address.
> > Delete NOSPAM from the email address after clicking Reply.

>
>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Batch file to rename file based on file size Brandon Windows XP 14 10-17-2008 01:45 AM
calling multiple batch files from within a batch file yawnmoth Windows XP 3 05-26-2008 10:50 AM
Batch file works in command line but not as a batch Danger Windows XP 7 02-05-2008 09:00 AM
Save batch window msgs to a file from the batch prog Stephen Rainey Windows XP 3 01-09-2007 06:15 PM
how to execute batch file automatically when file is added in folder SANDY Windows XP 4 01-04-2007 03:48 AM


New To Technology Questions? Do You Need Help with Your Computer or Device? Do You Need Help with this site?

All times are GMT -8. The time now is 12:43 PM.


2003 - 2010 All Rights Reserved. Technology Questions

Search Engine Friendly URLs by vBSEO 3.3.0