6

I knew many restricted and special characters in file and folder names that impossible to use, or they can cause trouble later.

For example putting a dot at the end of the name will cause it to disappear.

Explorer itself has more restrictions, for example a dot at the beginning of filename is very hard to put.

OK, but what's wrong with at-sign @ !?
I didn't saw anywhere any restrictions about it, nor could I find it now.

See:

1) Open Windows Explorer and create a file or folder with name 1,1
2) Press F2 and rename it to @1,1
3) See? New name was cancelled.

My question is: WHY?

I tested this "feature" on XP, Win7 and Win10.
Funny thing in WinXP is that renaming 0,0 to @0,0 actually renames it to @0.

Looks like this is internal Explorer behavior, because in CMD console it is perfectly fine to do cd.>"@1,1"

  • I just tried this on Windows 7, and I can’t reproduce your result — I can rename a file, with Explorer, to a name that includes @, with no problems. – Scott Nov 4 '17 at 7:04
  • @Scott, it is somehow related to comma , especially if there is a numeric after it. @ must be the first character. Did you try my specific example? Hmm it also may be locale-dependent… I have Russian locale where , is separator for real numbers (1,5 means 1 and a half, not 1.5 as in English locale). – aleksusklim Nov 4 '17 at 7:10
  • I did now.  I took a PNG file and renamed it to @0,0.png, and then to just plain @0,0.  I got the warning about changing an extension, but when I hit OK, the rename worked.  (I am in USA.) – Scott Nov 4 '17 at 7:14
  • @Scott, Well, I cannot create @1,1.png Looks like locale is related. Did you try @1,1 (since @0,0 is buggy only for XP, in Win7 and later it renames fine), or maybe you'll try @1.1 ? Not sure it will show that, though. – aleksusklim Nov 4 '17 at 7:19
  • 1
    Ah, now I am getting weird results. Based on 42 seconds of testing, it looks like attempts to rename to @1,1 silently fail (leaving the name unchanged). – Scott Nov 4 '17 at 7:26
8

I don't know why Explorer forbids such renames, but it's likely to do with a localization feature.

Various parts of Explorer use the @<DllName>,<ResourceID> syntax for dynamically loading localized text – see registry string redirection. (Note that the resource ID is always a decimal number, often negative.)

  • For example, the description for .lnk shortcuts in Registry is @shell32.dll,-4153, which means "load string with ID -4153 from file shell32.dll". Since DLL files can have a separate resource table for every supported language, the resulting description will be translated to whatever display language Windows is set to.

  • Similarly, your Desktop; Documents; Pictures; ... directories have a hidden desktop.ini file containing:

    [.ShellClassInfo]
    LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21769
    IconResource=%SystemRoot%\system32\imageres.dll,-183
    

    When Explorer sees this file, it won't just show the folder as "Desktop" – it will show the translated name.

Simply using the redirection syntax in an actual file/directory name won't do anything, but my guess is that it was forbidden to prevent various bugs in case a program mixes up the "real" and "display" names in some manner. (For example, if you name a directory @shell32.dll,-21769, it is possible that a buggy program will keep trying to access Desktop instead. This might even create security issues.)

So that would be similar to various other names which Windows allows but Explorer does not (e.g. .foo which is a regular "hidden file" for Unixen, but can be mistaken for a nameless (extension-only) file by some Windows programs).

  • 3
    Oh my god, indeed! Why didn't I thought of that. Hey, now I actually tried to rename test directory to @shell32.dll,-21769 in WinXP Explorer, and it magically "renamed" it to visual name Рабочий стол ("Desktop" in Russian) which contains desktop.ini with LocalizedResourceName=@shell32.dll,-21769 line. When I tried to rename a file test – Explorer created desktop.ini right here with [LocalizedFileNames] and test=@shell32.dll,-21769. (Also, that "localized name" stuff by itself may be so-o-o confusing for a novice user, and could be possibly used by malware). – aleksusklim Nov 4 '17 at 14:20
  • Thanks for your edits and clarifying. So, I guess, I will use _@_ file prefix instead or my old @_ one. Actually, it was my naming scheme for downloaded video files: sometimes I make a backup copy of a video so I can safely delete it to save space; but often I don't want to delete it immediately since I didn't watch it yet. So, I used to put @_ prefix to the filename, so I could easily distinguish backuped ones. Lately I found a file which had the size in the name, in form like "Video (1,5 Gb).mp4" – then my scheme is failed on @_ Video (1,5 Gb).mp4. – aleksusklim Nov 4 '17 at 16:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.