Microsoft KB Archive/41137

MS-DOS Shell Variables Must Be Initialized PSS ID Number: Q41137 Article last modified on 09-16-1993 PSS database name: O_MSDOS

4.00 4.01

MS-DOS

= SUMMARY =

Example 3 on page 99 of the “Microsoft MS-DOS Shell User’s Guide” for versions 4.0 and 4.01 is incorrect.

When you use this example to create custom dialog boxes and variables, and you start a program that uses the dialog box variables, the following error message is displayed:

Parameter uninitialized in program startup command. = MORE INFORMATION =

The /D“%1” option in Example 3 in the “Microsoft MS-DOS Shell User’s Guide” is incorrect when invoked without a previous setting of the %1 parameter. It may function properly in some cases where the %1 variable is already initialized.

The /D“%1” option tells the MS-DOS Shell to use whatever is in %1 as the default entry. However, if the %1 variable has not been initialized, /D will fail. The /C“%1” option will use the last saved %1 variable from any process run within the MS-DOS Shell.

Therefore, if you set up and run Example 1 and then execute Example 3, you will get the expected results. If you execute Example 3 as the first application, the MS-DOS Shell will issue the “Parameter uninitialized in program startup command” error message. The MS-DOS Shell does not use a default value of null if the variable has not been initialized.

The /D“%n” option is not usually recommended because it is difficult to guarantee that your application will be executed at least once to initialize the variable.

NOTE: This documentation error does not occur in later versions.

Additional reference words: 4.00 4.01 noupd docerr

Copyright Microsoft Corporation 1993.