Re: Conditional execution using DOS batch file
- From: Ted Davis <tdavis@xxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 03 Oct 2005 08:00:49 -0500
On 3 Oct 2005 00:35:27 -0700, sbillore@xxxxxxxxxxxxxx wrote:
>Hi All,
>
>I am new to DOS batch programming.
>My aim is to define some config.h file.
>This file will contain some #define.
>Based on each #define i want to run some
>dos command.
>
>It is possible to write DOS batch file to do so?
>
>How we can include this config.h into DOS
>batch file then based on #define perform some
>DOS command execution.
>My hypothetical batch file would be:
>
>----------
>#include config.h
>
>#ifdef VAR1
>DOS command1
>DOS command2
>#endif
>
>#ifdef VAR2
>DOS command3
>DOS command4
>#endif
>----------
That's not the way batch files work. If you want to include something
in a batch file, you make it another batch file and CALL it.
There is no IFDEF in DOS (including Win9x), though there is something
similar in NT/W2K/XP batch language. Assuming that the variables in
question are environment variables, there are ways to manage the
program flow, but they vary depending on the operating system it's
for.
This group is primarily for highlevel, and perhaps assembly, languages
under real DOS. Your question is more properly asked in one of the
batch groups: alt.msdos.batch or alt.msdos.batch.nt, depending on
which operating system you are using.
The IF help ( IF /?) pretty much covers the basics, regardless of the
operating system.
--
T.E.D. (tdavis@xxxxxxxxxxxxxxxxxxxx)
SPAM filter: Messages to this address *must* contain "T.E.D."
somewhere in the body or they will be automatically rejected.
.
- References:
- Conditional execution using DOS batch file
- From: sbillore
- Conditional execution using DOS batch file
- Prev by Date: Re: DOS's future
- Next by Date: Re: MSDOS-Based Compilable Code for RSA / Other Public-Key Scheme
- Previous by thread: Conditional execution using DOS batch file
- Index(es):
Relevant Pages
|