0

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.

5
Contributors
5
Replies
11
Views
12 Years
Discussion Span
Last Post by jephthah
0

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) ;

}

0

This should work:

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

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

Edited by Dani: Formatting fixed

-2

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 by pritaeas: Fixed formatting

-1

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 by vino4all: n/a

1

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 topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.