Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search
Latest topics
» professional assembly language:(Ebook)
Sun Aug 09, 2009 2:54 pm by Admin

» C - Question Paper Quark Media House India Pvt. Ltd.
Tue Jul 08, 2008 2:02 am by Admin

» Simple Code in C which calls another exe file
Thu Jun 26, 2008 4:03 pm by mathes

» Cricket Game in C....Try this out...
Thu Jun 26, 2008 3:58 pm by mathes

» Calculator Program in PERL
Thu Jun 26, 2008 3:33 pm by mathes

» Airtel Music on C...Try This guys
Thu Jun 26, 2008 3:30 pm by mathes

Search
 
 

Display results as :
 


Rechercher Advanced Search

Current date/time is Fri Nov 27, 2009 5:38 pm

Post a reply

Post a reply
 

HTML is ON
BBCode is ON
Smilies are ON

  
Options



Jump to:  

Topic review

Simple Code in C which calls another exe file

by mathes on Thu Jun 26, 2008 4:03 pm

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.