Skip the navigation

Why can't I use punctuation in a file name?

MLStrand56 complained to the Windows forum about Windows' inability to save file names containing punctuation.

By Lincoln Spector
November 23, 2012 02:38 AM ET

PC World - MLStrand56 complained to theA WindowsA forum about Windows' inability to save file names containing punctuation.

[Email your tech questions toA answer@pcworld.comA or post them on theA PCW Answer Line forum.]

Actually, the problem isn't anywhere near as serious as some might think. Of the 32 punctuation characters available on your keyboard, all but nine can be used in file names.

The nine that can't are:

On the other hand, if you use Microsoft Word, you might think that all punctuation is blocked. Here's why:

When you save a new file in Word, the program brings up the Save As dialog box, and inserts the document's opening text as a likely file name. But Word truncates that text at the very first punctuation mark it finds. In other words, if your document starts with the titleA Pilgrim's Progress,A Word will suggest you save the file asA Pilgrim. But you don't have to accept that. You can type or paste in the full name, with the apostrophe, and save the file.

But you still can't save a file with one of those nine characters. Why?

Windows, like DOS before it, uses these symbols for searches, command-line instructions, and the paths that define file locations. For instance, I'm currently writing in a file calledA November Answer Line.docx,A inside myA 1211A folder, which is inside myA DropboxA folder, insideA Documents, insideA Lincoln, on my D: drive. The file's full path, including the name, isA D:\Lincoln\Documents\Dropbox\1211\November Answer Line.docx.

If I could rename the fileA November\Answer:Line.docx, Windows wouldn't know ifA NovemberA was a folder or part of the file name. To avoid that confusion, the OS simply bans the backslash (\) from file names.

Frankly, I wish Microsoft was stricter about this sort of thing, and didn't allow us to use periods (.) in file names.

In every file name, a period separates the name, which tells you what's in the file, from the extension, which tells Windows what type of file it is. Since Windows, by default, hides extensions, an extra period in the file name can make one type of file look like another.

Malware developers like that trick. As recently asA September, the TrojanA Troj/Backdr-HGA spread with the help of a file called Microsoft-Services-Agreement.pdf.exe, which looked to many users like Microsoft-Services-Agreement.pdf.

People thought they were opening a .pdf, when they were really launching a program.

Read the originalA forum discussion.

Originally published on Click here to read the original story.
Reprinted with permission from Story copyright 2012 PC World Communications. All rights reserved.
Our Commenting Policies