Previous Next

Using the Setenv.bat Command Line

When you open one of the build environments, a batch file named setenv.bat executes in this window. This sets the environment variables to their default values for this environment.

In most cases, it is not necessary for you to directly invoke the setenv.bat file. However, you may find this useful when writing scripts that will execute several sequential builds.

The command-line syntax is as follows:

setenv Directory [fre|chk] [64|AMD64] [hal] [W2K|WXP|WNET] 

setenv Directory -? 

All parameters except for Directory are case-sensitive.

Parameters

Directory
Specifies the DDK installation directory.
fre
Specifies the free build environment. This can be abbreviated f.
chk
Specifies the checked build environment. This can be abbreviated c.
64
Specifies the Itanium-based build environment.
AMD64
Specifies the AMD x86-64 build environment.
hal
Specifies the HAL build environment.
W2K
Specifies the Windows 2000 build environment.
WXP
Specifies the Windows XP build environment.
WNET
Specifies the Windows Server 2003 build environment.
-?
Displays a short help text. You need to supply Directory for this to work, but you can use any string as a placeholder for Directory.

Example

If you open a new Command Prompt window and execute

setenv D:\ddk chk 64 WXP 

it will set up a 64-bit Windows XP checked build environment, as long as D:\ddk is indeed your DDK installation directory.

Writing Scripts

If you are going to write a script that will automatically launch the build utility, you should not run setenv.bat twice in the same Command Prompt window. Although setenv.bat will set all the environment variables needed for any given build environment, it may not delete the environment variables set by a previous use of this command.

Therefore, if you plan to run sequential builds of different types from a batch file, you should use a format along these lines:

cmd
setenv b:\ddk chk 64 WXP
exit
cmd
setenv b:\ddk fre 64 WNET
exit