Sunday, April 08, 2007

Names you can't drop with XP/Vista

Ever try to use what you think would be the perfect name for a file in Windows and get it tossed back in your face?

ComputerZen guru and .NET programmer extraordinary Scott Hanselman recently ran into that issue with Vista: Naming a File a Reserved Name in the Windows Vista Operating System

It's a great read on how programmers and folks need to keep that information under consideration.

(Go check out his new blog layout! It is wicked-nice!)

The No-No list for Windows Users

If you just want the facts, Scott drops the following from a great MSDN page: Naming a File

Do not use the following reserved device names for the name of a file: CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. Also avoid these names followed by an extension, for example, NUL.tx7.

CLOCK$ is also a reserved device name.

The No-No Characters in Filenames List

Of course, while OS X users make off better than Windows users, they still face some limitations when using characters in file names.

Forbidden Characters in Filenames -, Mac OS X vs. Windows XP

OS X prohibits only the colon : character, because this character is used to represent a directory in HFS+ (OS X's default filesystem).


XP restricts the use of the * . " / \ [ ] : ; | = , characters in a file or folder's name.

Apparently, mileage on permitted use of those characters may be different in a Windows application (say Word) than from the system (Windows Explorer).

Removing Files with Reserved Names

So what happens if you just want to live on the edge and say, delete one of those specially named files?

Basically, either way it takes some special command line Jujutsu.

What's that you say? Not up to command line Jujutsu?

Try the quite effective JRTS - Delete FXP Files utility. It comes in several flavors, including a freeware (for personal use) version. It has a very easy to use GUI interface for the command line intimidated.

It's very nice, but may be eventually phased out, so you might want to download a copy now, just in case...even if you don't need it now (and it isn't something you will probably need on a daily basis).

Bonus Microsoft Helps

Here are two fascinating (OK, for geeks) Microsoft articles that are highly detailed in their technical data. Bookmark 'em as you might need them one day while troubleshooting!

Microsoft TechNet: How NTFS Works

Windows XP Resource Kit: Troubleshooting the Startup Process

Now you know!


No comments: