Help and Support

Using MS-DOS Environment Variable as Command-Line Option

Article ID:153163
Last Review:November 15, 2006
Revision:1.1
This article was previously published under Q153163

SYMPTOMS

When you use an MS-DOS environment variable (such as %VARIABLE%) as a command-line option when you run a program (such as Notepad), you may receive the following message:
   Cannot find the %VARIABLE%.txt file.

   Do you want to create a new file?
				

Back to the top

CAUSE

Windows 95 interprets the environment variable as a file name because the percent (%) character is a valid character in a long file name in Windows 95.

Back to the top

RESOLUTION

To work around this behavior, use any of the following methods:

Use the following method to start the program:

1.Click the Start button, and then click Run.
2.Type the following command in the Open box
command.com /c <program.exe> %<variable>%
where <program.exe> is the program you want to run and <variable> is the environment variable you want to use.
Create an MS-DOS batch file that starts the program with the command- line variable set to the appropriate MS-DOS environment variable. Then, create a shortcut to the batch file and use the shortcut to start the program.
Start an MS-DOS session and type the command at the command prompt.

Back to the top


APPLIES TO
Microsoft Windows 95

Back to the top

Keywords: 
KB153163

Back to the top

Article Translations

 

Other Support Options

  • Contact Microsoft
    Phone Numbers, Support Options and Pricing, Online Help, and more.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.