I've often heard that pipes create a new instance of cmd..
I don't see it though
If I go to e.g. the windows directory and I do dir /p | more, then I don't see a new cmd.exe instance appear in task manager.
i'm also interested in when that has ramifications that some might not foresee.
thanks
can anybody demonstrate the pipe creates new instance of cmd, issue?
Moderator: DosItHelp
Re: can anybody demonstrate the pipe creates new instance of cmd, issue?
The new instance is most likely alredy terminated before the Task Manager updated the list. You will need blocking commands. E.g.
Steffen
Code: Select all
pause>nul|set /p "=Hello, World!"
Steffen
Re: can anybody demonstrate the pipe creates new instance of cmd, issue?
it seems to create two command processes
seems to be creating two cmd processes
So if I open a cmd.exe window, I have one showing in task manager
then I run that and I get 3 running. So it created two.
why?
I notice that pause or pause>nul, doesn't create a cmd process. So it seems like the pipe to set /p=asdf creates two.
Code: Select all
pause>nul|set /p=sdf
seems to be creating two cmd processes
So if I open a cmd.exe window, I have one showing in task manager
then I run that and I get 3 running. So it created two.
why?
I notice that pause or pause>nul, doesn't create a cmd process. So it seems like the pipe to set /p=asdf creates two.
Re: can anybody demonstrate the pipe creates new instance of cmd, issue?
That's what Process Explorer shows:
Steffen
Steffen
Re: can anybody demonstrate the pipe creates new instance of cmd, issue?
You should read the Q&A at http://stackoverflow.com/q/8192318/1012053.
There are lots of consequences discussed there.
Dave Benham
There are lots of consequences discussed there.
Dave Benham