locked
system() is not available in VC++ 2005 RRS feed

  • Question

  • Is there a VC++ 2005 substitute for system()? It worked in .NET 2003, but it appears to be unavailable in VS 2005.  I need some way to execute a command line statement from within my program - specifically to zip and unzip files.
    Monday, October 30, 2006 3:46 PM

Answers

  • Did you include <process.h>

    --
    SvenC

    Monday, October 30, 2006 4:00 PM
  • You can use CreateProcess function to run executable, or ShellExecute to run executable associated with file.
    Monday, October 30, 2006 4:00 PM

All replies

  • Did you include <process.h>

    --
    SvenC

    Monday, October 30, 2006 4:00 PM
  • You can use CreateProcess function to run executable, or ShellExecute to run executable associated with file.
    Monday, October 30, 2006 4:00 PM
  • Including process.h did the trick.  What still puzzles me is that the help system has nothing about the system() call.  There was no way that I know of in VS2005 that I could have discovered what was necessary to make the system call work.  The process.h header was not needed in the 2003 .NET version in order to be able to use system().

    Thanks for the help.

    Monday, October 30, 2006 11:08 PM