Latest topics
Search
Simple Code in C which calls another exe file
Page 1 of 1 • Share •
Simple Code in C which calls another exe file
Simple Code which calls another exe file named trojan.exe(torjan is for instance)
CODE
#include
#include
using namespace std;
void file()
{
ShellExecute(NULL, "open", "C:\\Program Files\\trojan\\trojan.exe",
NULL, NULL, SW_SHOWNORMAL);
}
int main()
{
file();
return 0;
}
NOTE: To use non-8.3 filenames on the command line, either escape the space ('Program\ Files' or "Program\\ Files\" in a C string), enclose the path in quotes ('"C:/Program Files/"') or use the 8.3 abbreviation ('Progra~1').
Using something like %SystemDrive%\program files\sub directory\program.exe if C: isn't the default directory as shown in the above code.
CODE
#include
#include
using namespace std;
void file()
{
ShellExecute(NULL, "open", "C:\\Program Files\\trojan\\trojan.exe",
NULL, NULL, SW_SHOWNORMAL);
}
int main()
{
file();
return 0;
}
NOTE: To use non-8.3 filenames on the command line, either escape the space ('Program\ Files' or "Program\\ Files\" in a C string), enclose the path in quotes ('"C:/Program Files/"') or use the 8.3 abbreviation ('Progra~1').
Using something like %SystemDrive%\program files\sub directory\program.exe if C: isn't the default directory as shown in the above code.
mathes- Number of posts: 20
Age: 20
Registration date: 2008-06-26
Permissions of this forum:
You can reply to topics in this forum









» C - Question Paper Quark Media House India Pvt. Ltd.
» Simple Code in C which calls another exe file
» Cricket Game in C....Try this out...
» Calculator Program in PERL
» Airtel Music on C...Try This guys