lists.zerezo.com



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

***BOGO*** Re: [Mingw-users] stop dos window from opening



Brian Dessent wrote:

> > This works fine (thanks), except if 2 commands are placed in one line.
> > E.g. set a temp. environment variable, then execute a program:
> > set ABC=c:\xyz & foo ifile ofile
> >
> > With system() this works fine (except for the annoying pop-up).
> >
> > How to handle double commands like this, using CreateProcess?
> 
> As I said, system() invokes its argument using the shell (i.e. the value
> of the environment variable COMSPEC, normally cmd.exe, with /C) which is
> what handles things like redirection and command pipelines.  You have to
> do this yourself if you use CreateProcess().

I also should point out that in your example you're just using the shell
to modify the environment of the child process, so it would be a lot
more efficient to simply pass the modified environment to the process
directly with the lpEnvironment parameter of CreateProcess() rather than
relying on the shell to do it for you.

Brian

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users