3

I have the latest version of Windows 10 (2021-04-07) and I would like to know if there is any correction in this version for the problem of creating folders with reserved names such as: AUX and etc?

Official limitation link: https://learn.microsoft.com/en-ca/windows/win32/fileio/naming-a-file?redirectedfrom=MSDN#naming_conventions

I am working on a project that contains a folder with that name "aux" in the GIT repository. Since most other developers use LINUX, they do not suffer from this problem.

If there is no solution I will have to exchange windows for Linux just for this detail. It would be frustrating.

Is there any solution to this problem? Any keys in regedit for example?

Thanks in advance

Junior
  • 199
  • 1
  • 9

1 Answers1

-1

As previously stated. It's a reserved word from back in MS-DOS, for the CONsole device (as far as I can remember). But, you can force Windows/dos to create the folder for you. For devices, it uses the format \.[RESERVED_WORD] to access the "file" (these devices used files for communication). To force Windows to create your folder, instead of doing mkdir [RESERVED_WORD], do the following:

mkdir \\.\[absolute path to folder of choice, including drive letter]\[RESERVED_WORD]

For example, to create CON folder on my desktop,

mkdir \\.\C:\Users\me\Desktop\CON

To delete the folder, you have to reference it the same way, or else it won't work.

rmdir \\.\C:\Users\me\Desktop\CON

My advice though is to just use a different name. It would be very difficult to always refer to it via its absolute path, especially if you are developing an app you plan on deploying. You could just rename the folder and use IFDEFs or the equiv in your programming language which would help out the Windows version of your project.

programmer
  • 36
  • 4
  • This does not answer the quesiont. It is not about a program that wants to create a file with a special name, but Git that wants to check out a directory with a special name. – j6t Apr 07 '21 at 13:11
  • Unfortunately it didn't solve the problem, I tried to make the clone using this absolute path, but without success. I Try: git clone --branch develop https://repo.git "\\.\D:\PathProject" – Junior Apr 07 '21 at 13:51
  • It does answer the question, you have to change the file names of the project in order to allow the git clone of the project on Windows. – programmer Apr 11 '21 at 20:26