Re: cmd.exe /c not automatically closing

W

Walter Briscoe

In message <[email protected]> of Thu, 7 Aug 2003
12:47:04 in microsoft.public.win2000.cmdprompt.admin, Craig Ferraguti
I have a VB program that uses the cmd.exe program on a
Windows 2000 Advanced Server computer. When SP3 was
installed the /c option would automatically close after
the program that cmd.exe spawned was completed. After
installing SP4 the cmd.exe no longer auto-closes. I have
also tried this from the run dialog. Again, the /c option
will work on the SP3 box but not the SP4. Is there
anything I can do to fix this? Or is Microsoft currently
working on the problem?
In Windows 2000 Professional SP3, I have a file C:\winnt\_default.pif.
If I open its Properties dialog (by right-clicking it or otherwise), the
Program tab has a "Close on exit" checkbox. That may be the relevant
control. (It had no immediate effect when I inverted it and I do not
want to do a reboot to confirm the guess at the moment.)
Why did you upgrade?
Could you use CreateProcess to start rsh rather than cmd?
 
C

Craig Ferraguti

Could you use CreateProcess to start rsh rather than cmd?

I'm actually using CreateProcess to spawn the cmd.exe that
I am passing the rsh command to. I had to call the
cmd.exe in order to redirect the results of the rsh to a
file. For some reason it wouldn't work without the
cmd.exe.

Today I figured out another way to do this. Instead of
calling the rsh command through the CreateProcess function
and waiting for it to terminate (which it never did), I
created a temporary batch file with the rsh command that
redirects the output to a file. Then I opened the batch
command with the CreateProcess function and waited for it
to return. Then opened the results file and grabbed the
data. I'm not sure why the same command works in a batch
file but not as a parameter to the create process function.
Why did you upgrade?
For the security updates mostly.

Thanks for your help,
Craig
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top