I am busy to make a program that starts with a menu, where
you can choose different options.
One of these options to execute a program.
for example :
download software in an flash-prom with loader.exe
loader idpartno.sr(where idpartno.sr is the code to be
downloaded.

Thanks for helping.

Use the shellExecute function. There's plenty of documentation on it in the MSDN. I copied this from a piece of one of my functions which wouldn't actually open notepad, it opens from a filename, in which case if it was a file with a *.txt extension it would open up the default application for that extension, in the case of .txt, Notepad. Hope this helps!

int iReturn = (int) ShellExecute(NULL, "open", "c:\\windows\\system32\\notepad.exe", NULL, NULL, SW_SHOWNORMAL);
// If ShellExecute returns an error code, let the user know.

if (iReturn <= 32)

{

MessageBox ("Cannot open file. File may have been moved or deleted.", "Error!", MB_OK | MB_ICONEXCLAMATION) ;

}

This should work:

#include <stdlib.h>
#include<stdio.h>

int main()
{
    (void)system("C:\\Windows\\System32\\notepad.exe");
    return(0);
}

Edited 3 Years Ago by Dani: Formatting fixed

This should work:

#include <stdlib.h>
#include <stdio.h>
int main()
{
    (void)system("C:WindowsSystem32notepad.exe");
    return(0);
}

Hi Dude,
This code is not working.
the system(); is compiled and returned a TRUE value. But couldn't get the output.

Try some other code.

Edited 3 Years Ago by pritaeas: Fixed formatting

I am busy to make a program that starts with a menu, where
you can choose different options.
One of these options to execute a program.
for example :
download software in an flash-prom with loader.exe
loader idpartno.sr(where idpartno.sr is the code to be
downloaded.

Thanks for helping.

#include <stdlib.h>
#include<stdio.h>
#include<windows.h>

int main()
{

ShellExecute(NULL,"open","d:\\vlc.exe",NULL,NULL,SW_SHOWNORMAL);

return(0);
}

This works good fellas.

Edited 6 Years Ago by vino4all: n/a

please check the dates before posting. youre responding to someone who posted over two years ago, who was posting to someone else from four years prior to that.

nobody cares about this thread or is paying attention, all its doing now is cluttering forum space and wasting time.

This article has been dead for over six months. Start a new discussion instead.