|
| | |||||||
| Windows XP Discuss the Microsoft Windows XP Operating System |
| | LinkBack | Thread Tools |
| |||
| 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? |
| |||
| 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? |
| |||
| 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? |
| |||
| 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? |
| |||
| 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? > > |
| |||
| 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? >> >> |
| |||
| 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? > >> > >> > > > |
| |||
| 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? >> >> >> >> >> >> >> |
| |||
| 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? >>> >> >>> >> >>> >>> >>> > > |
| |||
| 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. |
| |||
| 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. |
| |||
| 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. |
| |||
| 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. |
| |||
| 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? |
| |||
| 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. > > |
| Bookmarks |
| Thread Tools | |
| |
| | ||||
| 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? |