10

I use Windows 7 x64. You can try this on your computer, too.

Go take any file. Try to rename it to 'aux.svg'. Windows will answer with

The specified device name is invalid.

I tried this on two different computers (also Win7 x64), with the same results.
You can take any file you want. You can not rename it to 'aux.svg'. Dropbox will not download a file with that name. The browser will rename it to '_aux.svg' when downloading. This seems to happen in any directory I cared to try.

What the heck is happening here?

1
  • Most of the Win32 API, including Explorer and the common file dialogs, will not allow you to create files that match a couple old reserved DOS device names such as con, prn, aux.
    – LawrenceC
    Jul 3, 2013 at 20:32

3 Answers 3

16

This is one of the file names Windows bans for historical reasons. As far as I know, you have no way around it.

1
  • Great article! I just tested, I wasn't able to create files named aux.h, com1.h, or nul.h on my win 10 x64 system, and I now know that's because of a design decision that was made nearly 50 years ago!
    – Samuel
    Aug 19, 2022 at 17:38
3

To add to alexandru's answer:

You can bypass file name parsing by using a path such as:

\\?\C:\Users\Paperflyer\aux.svg

del and rename in Command Prompt accept such paths. However, it's pointless to rename a file to aux, since you won't be able to access it from other programs.

2

As another addition two years later:

You can rename (and modify) to any reserved keyword with cygwin. If it's a directory, you can access it's contents with other programs on Windows, but not itself.

I came across this while compiling a program on a shared folder in a virtual machine. There was a folder named aux in the package, an immovable folder, which I extracted with cygwin formerly. So only way to get rid of is using cygwin again.

1
  • WSL will work too.
    – Samuel
    Aug 19, 2022 at 19:56

Not the answer you're looking for? Browse other questions tagged .