Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Batch Files Run from Within Other Folders May Fail


Symptoms

When you run a batch file from a different folder that contains non- alphabetic characters, you will receive the following error message:


The name specified is not recognized as an internal or external command,
operable program or batch file.


Steps to reproduce the problem:


  1. Create a folder named test(2) off your root directory.
  2. Create a batch file in the test(2) folder called test.bat.
  3. Insert the following lines in test.bat:

          echo off
    pause
  4. Save test.bat.
  5. From the root directory at a command prompt, run the batch file with the following line:

    \test(2)\test.bat 
Notice the error message received:


The name specified is not recognized as an internal or external command,
operable program or batch file.

↑ Back to the top


Workaround

Although the batch file does not run from the root directory, the command will run if you enclose the command line within quotes. For example, for the above situation, a user should enter the following line in a command prompt:


"\test(2)\test.bat"

This command will run the batch file normally.

↑ Back to the top


Status

Microsoft has confirmed this to be a problem in Windows NT version 4.0. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

↑ Back to the top


Keywords: kb, kbbug

↑ Back to the top

Article Info
Article ID : 175477
Revision : 5
Created on : 8/19/2020
Published on : 8/20/2020
Exists online : False
Views : 130