473,395 Members | 1,466 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

is it possible to run a C program from batch file.

hello friends,

Is it possible to run a C program from a batch file. I use Dev c/c++
compiler and store the program in
devc++/programs/examples/myprogram/one.c

Oct 24 '06 #1
5 7632
On Oct 23, 10:56 pm, sjayara...@gmail.com wrote:
hello friends,

Is it possible to run a C program from a batch file. I use Dev c/c++
compiler and store the program in
devc++/programs/examples/myprogram/one.c
You would want to compile the program first, but after that, yes, you
can run any program you write with a batch file. Otherwise, you would
be limited to displaying the source code or manipulating the file in
some way (you could use a batch file to compile it, though).

Oct 24 '06 #2

sj********@gmail.com wrote:
hello friends,

Is it possible to run a C program from a batch file. I use Dev c/c++
compiler and store the program in
devc++/programs/examples/myprogram/one.c
what is your problem???
Do you want to run *.c program(silly) or the o/p of *.c program means
*.exe file.

In batch file you can execute almost any executable file.

Regards,
Pankaj Maheshwari

Oct 24 '06 #3
On 23 Oct 2006 22:56:57 -0700, in comp.lang.c , sj********@gmail.com
wrote:
>hello friends,

Is it possible to run a C program from a batch file. I use Dev c/c++
compiler and store the program in
devc++/programs/examples/myprogram/one.c
Thats not a C programme, thats the source code for a programme.
Compile/link it into an executable and you can run it however you want
to.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Oct 24 '06 #4
Mark McIntyre wrote:
>
On 23 Oct 2006 22:56:57 -0700, in comp.lang.c , sj********@gmail.com
wrote:
one.c
Thats not a C programme, thats the source code for a programme.
The source code for a C program, is what a C program is.

N869
5.1.1.1 Program structure
[#1] A C program need not all be translated at the same
time. The text of the program is kept in units called
source files, (or preprocessing files) in this International
Standard.

--
pete
Oct 24 '06 #5
sj********@gmail.com wrote:
hello friends,

Is it possible to run a C program from a batch file. I use Dev c/c++
compiler and store the program in
devc++/programs/examples/myprogram/one.c
C:\>type devc++\programs\examples\myprogram\one.c
#include <stdio.h>

int main(void)
{
printf("This is one.c\n");
return 0;
}

C:\>copy con one.bat
@echo off
c:\Dev-Cpp\bin\gcc.exe devc++/programs/examples/myprogram/one.c
a.exe
del a.exe
^Z
1 file(s) copied.

C:\>one
This is one.c

--
Simon.
Oct 25 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: brad | last post by:
I am new to perl and would like to know how to check the return values of a perl program in a batch file. how can I save the return value of the perl program and use it to make decisions as to...
5
by: Patrice FRITSCH | last post by:
I'm trying to run a batch file from an asp page using WScript.Shell object. Dim oWSH set oWSH= Server.CreateObject("WScript.Shell") call oWSH.Run("cmd.exe /c " & szCmd , 0, true) szCmd...
0
by: joeted | last post by:
Hi, I am using system.diagnostic.process with the intention of running a program to communicate with a unix box: The program is "PuTTY", running from a batch script. I know it works because...
0
by: wayne hamilton | last post by:
I'm having a problem Interacting with Command Line programs. I can read and write anything I want as long as I don't have to interact with a process once it's started. Originally I had been calling...
2
by: Silent | last post by:
Hello everybody..i'm knew here and looking for a bit of help..heres my problem: I am in the process of building a program to Install some programs silently from a PC. this program is basically a...
0
by: sunrt | last post by:
We have an As400 system that has program which executes batch files which resides on the SQL server 7.0 computer . Those batch files run SQL server jobs using isql. The whole idea about this is...
5
by: chenthil | last post by:
In my Java program I need to call two DOS batch programs namely call.bat and start.bat. First I need to start the batch program call.bat and once that program is completed, I need to call the other...
9
by: sesling | last post by:
We have several batch programs that users need to run each day to move data around our system. The batch files require the user to enter criteria when launching the program. To help simplify this I...
0
by: Raakish | last post by:
Hello I am trying to use a batch file to run a DTS program that I had created. Below is the Batch File code: REM Type: Batch File REM Created by: Raakish REM Contact: raakish22@gmail.com REM...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.