Short names in NTFS are a compatibility feature for DOS systems that only support 8.3 file names (a file name that consists of up to eight characters, followed by a period and an extension of up to three characters). You can use the dir /x
command to display the short names of the files and folders in the current directory.
For example, the folder “C:\Program Files” has the short name “PROGRA~1”. To create a new folder with the short name “PROGRA~1” and make “C:\Program Files” become “PROGRA~2”, you will need to name the new folder something that will result in the short name “PROGRA~1” when it is created. Some possible names that you could try include “Program Files”, “Program Fil”, and “Program File”.
If you have already tried these names and they have not worked, you can try changing the creation, modification, and last write times of the folder using the following PowerShell commands:
$(Get-Item "Program Files").creationtime=$(Get-Date "01/01/2010 00:01 am")
$(Get-Item "Program Files").lastaccesstime=$(Get-Date "01/01/2010 00:01 am")
$(Get-Item "Program Files").lastwritetime=$(Get-Date "01/01/2010 00:01 am")
3 Answers
Introduction
NTFS, which stands for New Technology File System, is the default file system used by Windows operating systems. It was first introduced with Windows NT 3.1 in 1993 and has since become the standard file system for all versions of Windows, including Windows 10. One of the features of NTFS is short names, which were designed to ensure compatibility with older operating systems that only support 8.3 file names. In this blog post, we will explore short names in NTFS and how to work with them in Windows 10.
What are Short Names?
Short names are a feature of NTFS that allows for compatibility with older operating systems that only support 8.3 file names. An 8.3 file name is a file name that consists of up to eight characters, followed by a period and an extension of up to three characters. For example, “example.txt” is a valid 8.3 file name, while “thisisaverylongfilename.txt” is not.
Short names are automatically generated by NTFS when a file or folder is created. They are based on the first six characters of the long file name, followed by a tilde (~) and a number. For example, if you create a folder named “Program Files”, its short name will be “PROGRA~1”. If you create another folder with the same name, its short name will be “PROGRA~2”, and so on.
Viewing Short Names
To view the short names of files and folders in Windows 10, you can use the command prompt and the dir /x
command. Open the command prompt by pressing the Windows key + R and typing “cmd” in the Run dialog box. Once the command prompt is open, navigate to the directory where the file or folder is located using the cd
command.
Once you are in the correct directory, type dir /x
and press Enter. This will display a list of all the files and folders in the directory, along with their short names. You can use this information to create new files or folders with specific short names.
Creating Folders with Specific Short Names
If you need to create a new folder with a specific short name, you can do so by naming the folder in a way that will result in the desired short name. For example, if you want to create a folder with the short name “PROGRA~1”, you can name the folder “Program Files”. However, if this name is already taken, you will need to try a different name that will result in the desired short name.
Some possible names that you could try include “Program Fil” or “Program File”. These names will result in the short name “PROGRA~1” when the folder is created. If none of these names work, you can try changing the creation, modification, and last write times of the folder using PowerShell.
Changing Folder Time Stamps Using PowerShell
To change the creation, modification, and last write times of a folder using PowerShell, follow these steps:
1. Press the Windows key + X and select “Windows PowerShell (Admin)” from the menu.
2. In the PowerShell window, navigate to the directory where the folder is located using the cd
command.
3. Type the following command to change the creation time of the folder:
$(Get-Item "FolderName").creationtime=$(Get-Date "01/01/2010 00:01 am")
Replace “FolderName” with the name of the folder you want to modify.
4. Type the following command to change the last access time of the folder:
$(Get-Item "FolderName").lastaccesstime=$(Get-Date "01/01/2010 00:01 am")
Replace “FolderName” with the name of the folder you want to modify.
5. Type the following command to change the last write time of the folder:
$(Get-Item "FolderName").lastwritetime=$(Get-Date "01/01/2010 00:01 am")
Replace “FolderName” with the name of the folder you want to modify.
By changing the time stamps of the folder, you can force NTFS to generate a new short name for the folder when it is created. This can be useful if you need to create a new folder with a specific short name that is already in use.
Conclusion
Short names are a compatibility feature of NTFS that allow for compatibility with older operating systems that only support 8.3 file names. They are automatically generated by NTFS when a file or folder is created and are based on the first six characters of the long file name, followed by a tilde (~) and a number.
To view the short names of files and folders in Windows 10, you can use the command prompt and the dir /x
command. If you need to create a new folder with a specific short name, you can do so by naming the folder in a way that will result in the desired short name. If this is not possible, you can try changing the time stamps of the folder using PowerShell to force NTFS to generate a new short name.
Yes, that’s correct. Short names in NTFS are used to maintain compatibility with older systems that only support 8.3 file names. The dir /x
command can be used to display the short names of the files and folders in the current directory.
It’s worth noting that Windows no longer generates short names for new files and folders by default, but it will still use them if they exist. In addition, short names are not displayed in the user interface, so you will need to use the dir /x
command or the PowerShell commands mentioned in your question to see them.
It’s also important to note that you should generally avoid creating or renaming files and folders with short names, as this can cause problems with some applications and features. If you do need to create a new folder with a specific short name, you may need to experiment with different names to find one that will result in the desired short name when it is created.
In summary, short names in NTFS are a compatibility feature that allows older systems to access files and folders on an NTFS volume. They are not displayed in the user interface and should generally be avoided when creating or renaming files and folders. If you do need to create a new folder with a specific short name, you may need to experiment with different names to find one that will result in the desired short name when it is created. The dir /x
command or PowerShell commands can be used to view the short names of the files and folders in the current directory.
Short names, also known as 8.3 names, are persistent and cannot be changed by simply modifying the alphabetical order or timestamps of the file or directory. They are assigned when the object is created and stored within the filesystem like regular names. If you have a directory named “PROGRA~1”, it will not become “PROGRA~1” as long as you have another directory with that name.
To directly change the 8.3 name of any path, you can use the Win32 API function SetFileShortName(). You can also use Python ctypes or write a short program to accomplish this.
Alternatively, you can rename the “Program Files” directory to something else, such as “asdf”, which will free up its short name. Then, you can create a new directory named “PROGRA~1”. Once this is done, you can rename the “Program Files” directory back to its original name, and it will be assigned the short name “~2”.