Click to See Complete Forum and Search --> : Using shellexecute or createprocess, or what?


Thranil
April 26th, 1999, 03:36 PM
I'm trying to find a way to execute a command (something like "dir *.*") in Win98. I've looked up the documentation (all that I have at least) on ShellExecute and CreateProcess and seem none the wiser. Should I use one of these functions, or should I use something else? And how?

Thanks in advance,
Thranil

Rob Wainwright
April 26th, 1999, 03:59 PM
Either one of these functions is fine if you want to execute another process. I tend to always use CreateProcess.

However, if all you're trying to do is enumerate files within your directory structure you do not need to shell out to another process to do this. You should use the File enumeration APIs within Win32 SDK. These are wrapped up within a CFileFind class (I think) within MFC.

Thranil
April 27th, 1999, 01:47 PM
Well, essentially what I am trying to do is take a look a the directory tree and filter out unwanted directories. Is there an easier way to do this than pipe a formated tree from a DOS command (not DIR) into a file and then search it?