Thread: Run File - magical mystery language

  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    5

    Run File - magical mystery language

    Hi, I am very new to C programming, so apologies.

    I am using Windows NT. I have a programme that creates aresults txt file from a measuring machine. I have a .bat file that I store on the C drive which copies each file to the network, firstly renaming it. The issue is that I have to manually execute the .bat file each time. I would like it to run in the background.

    Could someone help me with the code that at the end of my current programme will force the .bat file to run?

    File name is: MEA.bat

    Many thanks

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    system( "me.bat" );


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User
    Join Date
    Jul 2010
    Posts
    5
    Thanks for the reply - I couldn't get it to work - came up with an error, so i've attached the actual code - sorry should have done that in the first place to explain it clearly

  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    What programming language is that? Looks like Pascal or Delphi.

  5. #5
    Registered User
    Join Date
    Jul 2010
    Posts
    5
    I'm not sure - I'm really new to this, so just trying to alter the original code to do what I need

  6. #6
    Registered User
    Join Date
    May 2010
    Location
    Naypyidaw
    Posts
    1,314
    How is it related to C programming?

  7. #7
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Not C, so moved.
    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.

  8. #8
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Quote Originally Posted by wilds View Post
    i'm not sure - i'm really new to this, so just trying to alter the original code to do what i need
    lol.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  9. #9
    Registered User
    Join Date
    Jul 2010
    Posts
    5
    So nobody knows then???

  10. #10
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    On a Windows system, Google for "Scheduled Tasks", and check your "help" topics, also. On Linux, for "Cron jobs", and the "man" pages.

    Background programs in Windows are "services", and have no display window, at all. Services need to be installed, and registry entries changed. Google for "Windows service install program", and be sure it works on your specific version of Windows.

    I couldn't add code to your program, however.

  11. #11
    Registered User
    Join Date
    May 2010
    Posts
    4,632
    How about running your program from your bat file?

  12. #12
    Registered User
    Join Date
    Jul 2010
    Posts
    5
    Thanks for the feedback guys will give it a go

  13. #13
    Registered User
    Join Date
    Oct 2008
    Posts
    1,262
    Quote Originally Posted by wilds View Post
    I'm not sure - I'm really new to this, so just trying to alter the original code to do what I need
    So... basically... You learn a programming language but don't know even what language you're learning? What are you using to compile/interpret it?

  14. #14
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    wilds, where did you get that script? Giving us the source will help.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File transfer- the file sometimes not full transferred
    By shu_fei86 in forum C# Programming
    Replies: 13
    Last Post: 03-13-2009, 12:44 PM
  2. To find the memory leaks without using any tools
    By asadullah in forum C Programming
    Replies: 2
    Last Post: 05-12-2008, 07:54 AM
  3. Can we have vector of vector?
    By ketu1 in forum C++ Programming
    Replies: 24
    Last Post: 01-03-2008, 05:02 AM
  4. Basic text file encoder
    By Abda92 in forum C Programming
    Replies: 15
    Last Post: 05-22-2007, 01:19 PM
  5. file & linked list run time error
    By Micko in forum C Programming
    Replies: 9
    Last Post: 03-06-2004, 02:58 AM