Command Prompt's Treatment of Long File Extensions

Article translations Article translations
Article ID: 164351 - View products that this article applies to.
This article was previously published under Q164351
IMPORTANT: This article contains information about editing the registry. Before you edit the registry, make sure you understand how to restore it if a problem occurs. For information about how to do this, view the "Restoring the Registry" Help topic in Regedit.exe or the "Restoring a Registry Key" Help topic in Regedt32.exe.
Expand all | Collapse all

SYMPTOMS

When you perform file management using wildcards from the command prompt, files with long extensions may be unexpectedly displayed, copied, or deleted.

CAUSE

By default, Windows NT 4.0 mimics the Windows 95 behavior of truncating long file extensions under certain operations from the command line. File management operations directed at a 3 digit extension may also include files with an extension containing more than 3 digits where the first 3 digits match the operation argument.

This behavior only affects file management commands such as dir, del, move, and copy that are executed at a command prompt. File management operations performed by Find, File Manager, or Windows NT Explorer do not perform in this manner.

RESOLUTION

WARNING: Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk.

For information about how to edit the registry, view the "Changing Keys And Values" Help topic in Registry Editor (Regedit.exe) or the "Add and Delete Information in the Registry" and "Edit Registry Data" Help topics in Regedt32.exe. Note that you should back up the registry before you edit it.

To control this behavior, perform the following steps:
  1. Start Registry Editor (Regedt32.exe) and go to the following subkey:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSyst
  2. Edit the following value:
    Win95TruncatedExtensions : REG_DWORD : 0/1 [Default=1]
    The following is an example showing the behavior with each setting on a directory containing the two files:
    - htm
    - html
    Default behavior of Win95TruncatedExtensions set to 1:
    DEL *.htm - Deletes both 1.htm and 2.html.
    DEL *.html - Deletes 2.html.
    Modified behavior of Win95TruncatedExtensions set to 0.
    DEL *.htm - Deletes 1.htm
    DEL *.html - Deletes 2.html
  3. For the changes to take effect, restart your computer.

Properties

Article ID: 164351 - Last Review: November 1, 2006 - Revision: 1.1
APPLIES TO
  • Microsoft Windows NT Workstation 4.0 Developer Edition
  • Microsoft Windows NT Server 4.0 Standard Edition
Keywords: 
kbprb kbusage KB164351

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com