Open a folder?

So I want to open up a folder using c++. For example:
I open the program, a new window pops up and that window is a folder call, lets
say: C:\php And then the program closes but the folder stays open, is this possible? Thanks!
-Nile
Please help!!!
Last edited on
1
2
3
4
5
6
#include <stdlib.h>

int main(){
system("explorer C:\\php");
return 2;
}
Last edited on
Thanks, I'll try it. :)
Works! But how would I make the program close? But not the window?
Last edited on
Since you want a new "window" i am guessing you want a dialog with the file open or a main window with the contents of a folder.
You will need an API for that, since its GUI application.

Jeff
Last edited on
Im not the kinda person who knows everything about c++....
Can you provide the code Jeff please?
Please help.
PLEASE!
I found out how to do this today:
 
system("start explorer c:\\php");
You havn't read the above replies have you? I already have that code.. Without the start, and I don't think that it will close the other window...
Try to use an asyncronous spawn (spawn in _P_NOWAIT mode). For more details e.g. search for spawn in wikipedia
well, when I run this:
 
system("start explorer c:\\php");

... It opens that folder, and the program closes. Isn't that what you want?
Last edited on
I don't think that start is gonna make much of a difference but Ill try it.
Topic archived. No new replies allowed.