Thread: problem running a C file through cmd

  1. #1
    Registered User
    Join Date
    Mar 2020
    Posts
    2

    problem running a C file through cmd

    Hello everyone,
    I have a problem that might be simple but i really can't find its solution.

    I'm executing a batch file through cmd and one of the files is a c file.
    cmd returns: missing source file ..\..\SourceCode\filename.c
    I have visual studio 2013 installed.

    Does anyone help me solve that ?
    Thank you

  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
    Short, Self Contained, Correct Example
    We need more information than "a batch file" and "an error".

    Batch files don't run C source code.

    You need to compile your C code with a compiler (such as the one found in visual studio) to produce an executable (.exe) file.

    The .exe file is something you could call from your batch file.
    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
    Mar 2020
    Posts
    2
    The batch file is actually an exe .bat and the c file is a .c.
    The batch executes some codes .cpp and .c but only this .c file is returned missing through cmd.
    Last edited by thunderspeed; 03-01-2020 at 10:45 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. I'm having a problem running a dot execute file
    By papagym177 in forum C++ Programming
    Replies: 2
    Last Post: 01-08-2015, 02:59 PM
  2. Running an EXE file
    By peckitt99 in forum C++ Programming
    Replies: 2
    Last Post: 09-13-2007, 02:49 AM
  3. running exe file
    By majoub in forum C Programming
    Replies: 1
    Last Post: 04-24-2005, 02:56 PM
  4. Running a temporary file
    By Magos in forum C++ Programming
    Replies: 6
    Last Post: 05-27-2004, 05:48 PM
  5. running a external file
    By krappykoder in forum C++ Programming
    Replies: 5
    Last Post: 06-14-2002, 07:19 PM

Tags for this Thread