"Pegasus [MVP]" wrote:
>
> "\Rems" <(E-Mail Removed)> wrote in message
> news:8758C0C4-A643-483C-88C3-(E-Mail Removed)...
> > "Vilius Mockûnas" wrote:
> >
> >> Hello,
> >>
> >> By default cmd doesn't wait application to return if I type command
> >> interactively:
> >> >sol.exe
> >> But if I pass commands as cmd arguments - it will always wait app to
> >> return:
> >> >cmd /c sol.exe
> >>
> >> I want cmd to return immediately but I must use commands as arguments
> >> using
> >> /k or /c switches.
> >> How do I solve this ?
> >>
> >> thanks
> >> Vilius
> >>
> >
> > Running the command from within a batch? or by command line?
> >
> > try the difference between,
> > cmd /c Start ""/b ping sol.exe
> > and,
> > cmd /c Start cmd /c sol.exe
> >
> > In a batch you can skip the leading "cmd /c".
> >
> > \Rems
>
> In your command
> cmd /c Start ""/b ping sol.exe
> you can omit the extra command processor. It is sufficient to use
> start /b "" sol.exe
>
> In your command
> cmd /c Start cmd /c sol.exe
> you can omit both extra command processors. Again it is sufficient to use
> start /b "" sol.exe
>
> This command will work equally well at the Command Prompt or in batch files.
>
Yes I know that,
but thank you for clarifying.
Actually that was what I had in mind saying: "In a batch you can skip the
leading cmd /c ". And you're right, you also don't need the leading cmd /c
when typing it from a DOS-prompt, obviously.
The OP mensioned: "type command interactively >sol.exe"
However, note that the OP did also stated: "but I must use commands as
arguments using /k or /c switches" - So I wonder why that is... !
- The leading "cmd /c" IS needed when executing from Start | Run or using a
vbscript to run it.
- It could also be that the OP needs the supplement box (sample 2) for some
purpose.
Anyway, that is why my two samples look as they do, in addition to the
correctly dos command you posted a few days ago.
Thanks.
\Rems
|