This page shows the source for this entry, with WebCore formatting language tags and attributes highlighted.

Title

Removing illegal filenames in NT/2000

Description

I thought it was a shame that the guy was laughing at what sad bastards we are that we can't even clean up his mess (for 3 months). For future reference, here's how you do it (only works in Windows NT/2000, for Windows 95, 98, use a DOS utility like 'elim'): <c>dir /x</c> The <c>/x</c> switch shows short and long file names. All of the illegal folders had legible short file names. The first one was ~0200, where 20 is actually hexadecimal for 32, which is 'space' in ASCII. Once you know the folder name, you can delete it using the fully-qualified UNC path name. There's a special, secret syntax for specifying a folder on a fixed hard drive in UNC: <c>\.\\Drive:\Path\File</c> <n>Update: XP seems to use a ? intead of a . as the magic character.</n> Presumably, you can map a share to the drive and delete using that name as well, but this syntax gets around making a share. Finally, delete the file using <c>Del</c> or folder using <c>Rd</c>: <c>del \.\\Drive:\Path\File</c> <c>rd /S \.\\Drive:\Path</c> The <c>/S</c> switch will remove that folder and all subfolders and files. So now you know...and knowing is half the battle. Go Joe!