Welcome to RenEvo Sign in | Join | Help
in
Home IRC Wiisis C&C FarCry Blogs Forums Photos Downloads

Opening a .bat file

Last post 12-28-2006, 9:21 AM by Jary. 2 replies.
Sort Posts: Previous Next
  •  12-27-2006, 7:56 AM 542

    Opening a .bat file

    Hey all,

    Simple question.

     I'm wondering how from my console code, I can make it open ("run") a .bat file and not edit it. "open" just edits it.

     

    Thanks.

  •  12-28-2006, 8:57 AM 551 in reply to 542

    Re: Opening a .bat file

    Easiest way I can think of (the first that came to mind) is to use the function "system"; You use it as follows:

    system("C:\\MyProgram.exe");

    (Note the two back slashes) 

    Basically, any string you pass to system it treats like you typed it into the command prompt. There are other ways to execute programs from within programs which are better (and more secure) but this probably requires the least code.

  •  12-28-2006, 9:21 AM 553 in reply to 551

    Re: Opening a .bat file

    Thanks man :D
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems