Hello guys,

can anybody explain to me whats a simple batch processing facility ? i googled it but i couldnt understand anything.

thanks .

A "batch" is a collection of things (data or jobs) to be dealt with by running a single program once.

Hence, a batch processor is a program that will handle batches.

A classic example is the old DOS command.com. Rather than type in a zillion commands each time you want to do something, you can put them all into a file (so you only have to type them once), then each time you want to use them again all you have to do is tell command.com to process that file. The commands you would have had to type are all executed and life is easy.

(All command shells that I know of do that. On Unix systems there is sh, csh, tcsh, bash, zsh, etc. It is usually referred to as shell scripting, since it is a little more advanced than simple batch processing.)

Another example is using a program like Irfanview (image viewer). Suppose you have a directory full of 2000 random-sized images and you would like to convert them all to 256 by 256 pixels. Rather than load, size, and save each file by hand, you can program Irfanview to perform the resize command over all the files in the directory. Thus you can save yourself many hours of work.

Hope this helps.

hello Duoas, thanks for the information..this helped a lot.

well, can i ,( a beginner programmer ) write a batch ? if yes .. how does it look like ? like any c code ? it has to be compiled ?

if you know any intresting link that helps in that please send it to me.

thanks :=)

Sure. I use the Windows command prompt a lot, so I wrote a little batch file that I have set to be automatically executed whenever I start a command prompt.

I keep a lot of utilities in D:\bin\ , so I put the batch file there.


@echo off
set path=d:\bin;%PATH%
set dircmd=/ogn
doskey >nul
doskey cp=copy $*
doskey lesss=less -S $*
doskey deltree=rd /s/q $*
doskey vi=notepad $*
doskey dird=dir /ad /d $*
doskey python=C:\PROGRA~1\Python25\python.exe $*
doskey pythonw=C:\PROGRA~1\Python25\pythonw.exe $*
echo on

For those 557 of you who have found my mpath program [ 1 ], you know that I like to keep my command path uncluttered with junk and programs not currently in use. That includes the GCC toolchain. So I made myself some little batch files to initialize it if it is not already in the command path. For example:


@mpath a C:\PROGRA~1\MinGW\bin
@"g++" %*

This adds the GCC toolchain to the head of my command path, so that the next time I type g++ at the command prompt the batch file doesn't get executed again. Then it starts the g++ as normal.

At the prompt, this is convenient because whenever I want to compile something, all I have to type is g++ something.cc and all the right stuff happens without my having to worry about first adding the GCC to my command path.

For other types of batch processing you'll have to give me an idea of what you want to do.

BTW, unless you want to involve C somehow, this really is the wrong forum for this question...

well actually im intrested in creating batches in c language... where should i post my questions?

thanks for helping :)

What do you mean, "batches in the C language"?

Do you mean that you want to write a program that can process batch commands (like command.com or some other shell interpreter)?

Or do you mean that you just want to write scripts using C?