Reputation: 1997
In C++, what are the main differences between system()
and shellexecute()
?
In what situations should I use system()
and shellexecute()
?
Upvotes: 11
Views: 11654
Reputation: 473447
There's no such thing in standard C++ as shellexecute
. So there is no difference.
There's the Win32 function ShellExecute
, but that's a Win32 function, not a C++ standard function like system
.
ShellExecute
does a different thing from system
. system
is (more or less) equivalent to entering a command on the command line. ShellExecute
is the equivalent of double clicking a file (or right-clicking and selecting a "verb" from the list).
They really have nothing in common at all.
Upvotes: 9