Condividi tramite


Fsutil 8dot3name

 

Applies To: Windows 7, Windows Server 2008 R2, Windows Server 2012, Windows 8

Queries or changes the settings for short name (8dot3 name) behavior, which include:

  • Query the current setting for the short name behavior

  • Scan the specified directory path for registry keys that might be impacted if short names were stripped from the specified directory path

  • Change the setting that controls the short name behavior. This setting can be applied to a specified volume or to the default volume setting.

  • Remove the short names for all files within a directory

For examples of how to use this command, see Examples.

Syntax

fsutil 8dot3name [query] [<VolumePath>]
fsutil 8dot3name [scan] [/s] [/l [<log file>] ] [/v] <DirectoryPath>
fsutil 8dot3name [set] { <DefaultValue> | <VolumePath> {1|0}}
fsutil 8dot3name [strip] [/t] [/s] [/f] [/l [<log file.] ] [/v] <DirectoryPath>

Parameters

Parameter

Description

query [<VolumePath>]

Queries the file system for the state of the 8dot3 short name creation behavior.

If a VolumePath is not specified as a parameter, the default 8dot3name creation behavior setting for all volumes is displayed.

scan <DirectoryPath>

Scans the files that are located in the specified DirectoryPath for registry keys that might be impacted if 8dot3 short names were stripped from the file names.

set { <DefaultValue> | <VolumePath>}

Changes the file system behavior for 8dot3 name creation in the following instances:

  • When DefaultValue is specified, the registry key, HKLM\System\CurrentControlSet\Control\FileSystem\NtfsDisable8dot3NameCreationNtfsDisable8dot3NameCreationNtfsDisable8dot3NameCreation, will be set to the DefaultValue.

    The DefaultValue can have the following values:

    • 0: Enables 8dot3 name creation for all volumes on the system.

    • 1: Disables 8dot3 name creation for all volumes on the system.

    • 2: Sets 8dot3 name creation on a per volume basis.

    • 3: Disables 8dot3 name creation for all volumes except the system volume.

  • When a VolumePath is specified, the specified volumes on disk flag 8dot3name properties will be set to enable 8dot3 name creation for a specified volume (0) or set to disable 8dot3 name creation on the specified volume (1).

    You must set the default file system behavior for 8dot3 name creation to the value 2 before you can enable or disable 8dot3 name creation for a specified volume.

strip <DirectoryPath>

Removes the 8dot3 file names for all files that are located in the specified DirectoryPath. The 8dot3 file name is not removed for any files where the DirectoryPath combined with the file name contains more than 260 characters.

This command lists, but does not modify the registry keys that point to the files that had 8dot3 file names permanently removed.

For more information about the effects of permanently removing the 8dot3 file names from files, see Remarks.

<VolumePath>

Specifies the drive name followed by a colon or the GUID in the format Volume{GUID}.

/f

Specifies that all files that are located in the specified DirectoryPath will have the 8dot3 file names removed even if there are registry keys that point to files using the 8dot3 file name. In this case, the operation removes the 8dot3 file names, but does not modify any registry keys that point to the files that are using the 8dot3 file names.

Warning

It is recommended that you back up your directory or volume prior to using the /f parameter because it may lead to unexpected application failures, including the inability to uninstall programs.

/l [<log file>]

Specifies a log file where information will be written.

If the /l parameter is not specified, all information is written to the default log file:

%temp%\8dot3_removal_log@(GMT YYYY-MM-DD HH-MM-SS).log

/s

Specifies that the operation should be applied to the subdirectories of the specified DirectoryPath.

/t

Specifies that the removal of 8dot3 file names should be run in test mode. All operations except the actual removal of the 8dot3 file names are performed. You can use test mode to discover which registry keys point to files that use the 8dot3 file names.

/v

Specifies that all information that is written to the log file is also displayed on the command-line.

Remarks

  • Permanently removing 8dot3 file names and not modifying registry keys that point to the 8dot3 file names may lead to unexpected application failures, including the inability to uninstall an application. It is recommended you first back up your directory or volume before you attempt to remove 8dot3 file names.

Examples

To query for the disable 8dot3 name behavior for a disk volume that is specified with the GUID, {928842df-5a01-11de-a85c-806e6f6e6963}, type:

fsutil 8dot3name query Volume{928842df-5a01-11de-a85c-806e6f6e6963}

You can also query the 8dot3 name behavior by using the behavior subcommand.

To remove 8dot3 file names in the D:\MyData directory and all subdirectories, while writing the information to the log file that is specified as mylogfile.log, type:

fsutil 8dot3name scan /l mylogfile.log /s d:\MyData

Additional references

Command-Line Syntax Key

Fsutil

Fsutil 8dot3name

Fsutil behavior