Home / Microsoft / Microsoft DOS / batch files
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] - (Bottom) Print
Author Topic: batch files  (Read 540 times)
progach
Topic Starter
Rookie



Posts: 36

i am working hard to be the programmer

« on: November 05, 2009, 04:10:43 PM »


i am a new batch programming learner.

i want to write a batch file that can allow me to run a program with C language.how!nd tahnks
IP logged
billrich
Guest
« Reply #1 on: November 05, 2009, 09:29:12 PM »

i am a new batch programming learner.

i want to write a batch file that can allow me to run a program with C language.how!nd tahnks

Any executable program that will run from the command prompt  will run inside a batch file.

If you write the C program you will need to compile on windows.  Borland has a C compiler for windows.

Or install the Linux or Unix OS on your machine and use the Unix tools
IP logged
progach
Topic Starter
Rookie



Posts: 36

i am working hard to be the programmer

« Reply #2 on: November 06, 2009, 08:31:13 AM »

i already have borland c++
nd it been 2 years i program with c language using borlan compiler.what i need now is to call a one of my programs in C with a batch command nd execute it in DOS.thnks for the reply but if u ncan explain  more according the dos commands .
IP logged
billrich
Guest
« Reply #3 on: November 06, 2009, 07:45:32 PM »

I already have borland c++
And it been 2 years I program with c language using borland compiler.
What I need now is to call a one of my programs in C with a batch command and  execute it in DOS.  Thanks for the reply but if you can explain more according the dos commands .
.

Sed (stream editor ), a c program that was originally written in C and complied for Unix and Linux.  Sed has also been complied to work on windows.

I will demonstrate using sed in a batch file.  A batch file has a .bat extention and will  execute from the command prompt:



C:\>type patsed.bat
Code: [Select]
REM Use commandline argument: patsed.bat  113

@echo  off

sed 's/111/%1/'  pattie.txt

C:\>type pattie.txt

<param name="license_ports">

  <value>111</value>

</param>

OUTPUT:

C:\> patsed.bat  113

C:\>REM Use commandline argument: patsed.bat  113

<param name="license_ports">

  <value>113</value>

</param>

C:\>
IP logged
Pages: [1] - (Top) Print 
Home / Microsoft / Microsoft DOS / batch files « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.076 seconds with 20 queries.