Thread: is it possible ?

  1. #1
    Registered User
    Join Date
    Apr 2005
    Posts
    19

    is it possible ?

    is it possible to make a .bat file in c++ and run it ?

    and if so, can you guide me a bit cause i have been googling this for weeks now

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > is it possible to make a .bat file in c++ and run it ?
    Yes.

    > and if so, can you guide me a bit cause i have been googling this for weeks now
    With what?
    Creating the file, or running it?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Apr 2005
    Posts
    19
    Quote Originally Posted by Salem
    > is it possible to make a .bat file in c++ and run it ?
    Yes.

    > and if so, can you guide me a bit cause i have been googling this for weeks now
    With what?
    Creating the file, or running it?

    i think i can run it with

    Code:
    system("c:\\this\\is\\where\\my\\batfile\\is.bat");
    right ?

    if not i need help with both
    Last edited by Jalabert; 09-12-2005 at 06:51 AM.

  4. #4
    Registered User
    Join Date
    Jul 2005
    Posts
    33
    yes, the system command can run the bat, and yes, C++ can create a batch file. basic fstream commands. Check here http://www.cprogramming.com/tutorial/lesson10.html and instead of .txt use .bat ... your on your own after that, thats all the info you need
    Last edited by Warhawk; 09-12-2005 at 04:25 PM. Reason: an opps

Popular pages Recent additions subscribe to a feed