MSFN Forum: About cmd's 'start "" /wait' command - MSFN Forum

Jump to content



  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

About cmd's 'start "" /wait' command Just wanted to share this... Rate Topic: -----

#21 User is offline   -X- 

  • Member
  • Group: Patrons
  • Posts: 1,667
  • Joined: 08-January 04
  • OS:XP Pro x86
  • Country: Country Flag

Posted 11 March 2010 - 01:37 AM

no switch at all would be the same as 2
I think you mean no start.


#22 User is offline   Martin H 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 802
  • Joined: 24-November 06
  • OS:none specified

Posted 11 March 2010 - 10:49 AM

@g-force

Exactly, mate! :) (as X stated, if you by "no switch" means no START command in no.3, which i'm sure you do...)

This post has been edited by Martin H: 11 March 2010 - 10:58 AM


#23 User is offline   maxXPsoft 

  • MSFN Master
  • Group: Developers
  • Posts: 2,519
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 12 March 2010 - 08:19 AM

agree with g-force
Think this is a situation where some apps will continue and some will not, I've tried removing the /wait and turns into a nightmatre doing 20-30 apps. even on Seven 64 bit

#24 User is offline   submix8c 

  • Systems Annihilist
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,825
  • Joined: 14-September 05
  • OS:none specified
  • Country: Country Flag

Posted 12 March 2010 - 08:30 AM

Quote

So... the original assertion is somewhat correct (as it all depends on the process and/or program in question), but not entirely since in other cases it will be required.
Additionally, it may depend on the app in question as to how it "exits" and/or whether it calls other subroutines (e.g. dual-extract/execute... one-inside-the-other)???

Perhaps this is the reason the original recommendation was "start /wait" (cover all the bases, regardless).

Ennyhoo, a good learning experience with relevant information as to "how/why".

Aaannnd... Edit!!!
I re-read above; only says "removed wait"(See Next Post/Prev Posts)...

This post has been edited by submix8c: 12 March 2010 - 05:35 PM


#25 User is offline   Martin H 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 802
  • Joined: 24-November 06
  • OS:none specified

Posted 12 March 2010 - 04:18 PM

View PostmaxXPsoft, on 12 March 2010 - 08:19 AM, said:

agree with g-force
Think this is a situation where some apps will continue and some will not, I've tried removing the /wait and turns into a nightmatre doing 20-30 apps. even on Seven 64 bit

You havent read what I have stated throughout the whole thread then...

"start /wait" makes ZERO difference in BAT/CMD files...

YES, some apps dosent wait, but thats besides the point, as "start /wait" dosent fix it...

Lastly, you should not remove "/wait", but "start /wait"...

@submix8c

"start /wait" dosent cover the bases and are always 100% redundant in cmd/bat files...

This post has been edited by Martin H: 12 March 2010 - 04:29 PM


#26 User is offline   g-force 

  • Tester
  • PipPipPipPip
  • Group: Members
  • Posts: 596
  • Joined: 20-June 07
  • OS:XP Pro x86
  • Country: Country Flag

Posted 12 March 2010 - 11:34 PM

View PostmaxXPsoft, on 12 March 2010 - 08:19 AM, said:

agree with g-force
Think this is a situation where some apps will continue and some will not, I've tried removing the /wait and turns into a nightmatre doing 20-30 apps. even on Seven 64 bit

Agree - I use "setup.cmd" in some of my Silent-WinRAR-SFX (I usually install with this method).
Some Setups won`t install (or stuck) without that "start /wait" because of false or "too fast" execution.
I´m sure it makes a difference in a .cmd.

#27 User is offline   Martin H 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 802
  • Joined: 24-November 06
  • OS:none specified

Posted 13 March 2010 - 08:39 AM

Well, then lets agree to disagree then...

Btw, please give me an example of ANYTHING where "start /wait" makes a difference in cmd, and i will test it out...

Also, so you guys are not believing msft when they say in their technet article>

Quote

When you run a 32-bit graphical user interface (GUI) application, cmd does not wait for the application to quit before returning to the command prompt. This new behavior does not occur if you run the application from a command script.

Console apps never waits obviously, but gui apps are gui apps no matter if they are silently executed or not...

Quote

Notice that the operation of the START command differs from the default command shell sequence:

First, the START command never waits for the command to complete.

And hence, the /wait switch when using it... Said in another way, the /wait switch modifies the start commands normal behaviour, but NOT the command shells behaviour in any way...

If that was the case, then there would instead be a switch for cmd.exe itself to change that behaviour obviously...

Anyway, im done with this now if not getting an example, as i have proven it previously in this thread both with tests and technet quotes, so unless im givin an example to prove wrong, i dont want to continue repeaing myself here...

This post has been edited by Martin H: 13 March 2010 - 08:41 AM


#28 User is offline   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,019
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 13 March 2010 - 11:03 AM

Then explain why this cmd waits until notepad is closed before the message appears.
Perhaps I have been reading this wrong, but this Cmd script from what I read should
not wait for notepad to close before the message appears. That is not the case it
waits until notepad closes before the message appears.
@Echo Off
CLS
Mode 55,9

Echo.
Start /wait notepad
CLS
Echo.
Echo This does not show until Notepad is closed
pause



#29 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 9,107
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 13 March 2010 - 11:07 AM

View Postgunsmokingman, on 13 March 2010 - 11:03 AM, said:

Then explain why this cmd waits until notepad is closed before the message appears.
Perhaps I have been reading this wrong, but this Cmd script from what I read should
not wait for notepad to close before the message appears. That is not the case it
waits until notepad closes before the message appears.

What happens if you run this?:
@Echo Off
CLS
Mode 55,9

Echo.
notepad.exe
CLS
Echo.
Echo This does not show until Notepad is closed
pause



Anything different happening form the one you posted? :unsure:

jaclaz

#30 User is offline   Martin H 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 802
  • Joined: 24-November 06
  • OS:none specified

Posted 13 March 2010 - 04:37 PM

THANK YOU jaclaz, my friend! :)

Finnaly someone who understands what i've been saying for two pages now... (sorry, Yzöwl as ussual also does...)

Please everyone, READ before posting!!!

Edit: I didn't even have to, but anyway i've just tested this and obviously you know what the result was...

This post has been edited by Martin H: 13 March 2010 - 04:41 PM


#31 User is offline   briant 

  • Group: Members
  • Posts: 1
  • Joined: 26-May 10
  • OS:none specified
  • Country: Country Flag

Posted 26 May 2010 - 05:15 PM

Here's an example GUI application that won't wait, no matter if it's on the command line or in a script:

at the command prompt:
> start "" /wait "c:/Program Files/Mozilla Firefox/firefox.exe"
=> DOESN'T WAIT

in a .cmd file:
start "" "c:/Program Files/Mozilla Firefox/firefox.exe"
or
start "" /wait "c:/Program Files/Mozilla Firefox/firefox.exe"
=> DOESN'T WAIT

i think it's a function of how the application is programmed to exit.

#32 User is offline   Outbreaker 

  • Member
  • PipPip
  • Group: Members
  • Posts: 195
  • Joined: 08-August 07

Posted 26 May 2010 - 07:25 PM

You could try this:

Quote

START "" /WAIT "C:/Program Files/Mozilla Firefox/firefox.exe"
:CHECK
ping -n 10 localhost 1> NUL
TASKLIST /v /fi "IMAGENAME eq firefox.exe" 2>&1 > NUL
IF ERRORLEVEL 1 GOTO CHECK

This post has been edited by Outbreaker: 26 May 2010 - 07:28 PM


#33 User is offline   submix8c 

  • Systems Annihilist
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,825
  • Joined: 14-September 05
  • OS:none specified
  • Country: Country Flag

Posted 27 May 2010 - 11:46 AM

View Postbriant, on 26 May 2010 - 05:15 PM, said:

i think it's a function of how the application is programmed to exit.
I think that's what I was trying to say. :(

Share this topic:


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy