Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System vs ShellExecute - Differences?

Tags:

c++

winapi

In C++, what are the main differences between system() and shellexecute()?

In what situations should I use system() and shellexecute()?

like image 477
xRed Avatar asked Feb 16 '12 00:02

xRed


1 Answers

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.

like image 111
Nicol Bolas Avatar answered Oct 14 '22 11:10

Nicol Bolas