Results 1 to 2 of 2

Thread: anyone knows how to use the ShellExecute command?

  1. #1

    Default anyone knows how to use the ShellExecute command?

    I'm on Win XP, with cygwin installed.

    From the Windows command line, I can run the command ccygwin\bin\ls -l > filename

    This puts the output of the directory listing of the current directory into the file "filename"

    Now, I would like to execute this command inside a C program. Does anyone know how to do this? (what would the exact syntax look like in C ?)

    Also, I tried putting this at the header files in my C program using Visual Studio, but it errors out as I attempt to compile the code:

    #include "shellapi.h"

  2. #2

    Default Re: anyone knows how to use the ShellExecute command?

    I read up further on this, and it looks like I need to use CreateProcess.

    Anyone knows how I can solve the above problem using CreateProcess () ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •