Can anyone tell me what is the code in c programming for the shell function just like in visual basic it is:
Shell("C:\WINDOWS\CALC.EXE", 1)
Thank You
I believe the VB function is just a simplfied wrapper around Windows API ShellExecute.
The equivalent C code would be something like:
#include <windows.h>
ShellExecute(NULL,
NULL,
"C:\\WINDOWS\\System32\\CALC.EXE",
NULL,
NULL,
SW_SHOWDEFAULT);
You can try system() function in C.
An example:
system("calc.exe");
Edit: You need to use an escape sequence for representing a backslash, because it itself represents the starting point of defining an esc. sequence (e.g. \n), use \\ wherever you need to append \. For example:
system("My\\Long\\Long\\Path\\program.exe");
\ is a string escape character. You need to use \\ instead.
system