|
-
November 23rd, 2001, 12:11 PM
#26
Junior Member
This topic has been discussed many times on
netknowledgebase . com and this topic is covered on the Microsoft site as well.
[quote from ms]
SUMMARY
Because applications control the policy for creating files in Windows, files sometimes are created with illegal or reserved names, such as LPT1 or PRN. This article explains how to delete such files using the standard user interface.
MORE INFORMATION
NOTE: You must be logged on locally to the Windows computer to delete these files.
If the file was created on a file allocation table (FAT) partition, you may be able to delete it under MS-DOS using standard command line utilities (such as DEL) with wildcards. For example:
DEL PR?.*
-or-
DEL LPT?.*
These commands do not work on an NTFS partition as NTFS supports the POSIX subsystem and filenames such as PRN are legal under this subsystem. However, the operating system assumes the application that created them can also delete them; therefore, you can use commands native to the POSIX subsystem.
You can delete (unlink) these files using a simple, native POSIX application. For example, the Windows Resource Kit includes such a tool, Rm.exe.
NOTE: POSIX commands are case sensitive. Drives and folders are referenced differently than in MS-DOS. Windows 2000 and later POSIX commands must use the following usage syntax:
posix /c <path\command> [<args>] IE: posix /c c:\rm.exe -d AUX.
Usage assumes Rm.exe is either in the path, or the current folder:
rm -d //driveletter/path using forward slashes/filename
For example, to remove a file or folder named COM1 (located at C:\Program Files\Subdir in this example), type the following command:
rm -d "//C/Program Files/Subdir/COM1"
To remove a folder and its entire contents (C:\Program Files\BadFolder in this example), type the following command:
rm -r "//C/Program Files/BadFolder"
Another option is to use a syntax that bypasses the normal reserve-word checks altogether. For example, you can possibly delete any file with a command such as:
DEL \\.\driveletter:\path\filename
For example:
DEL \\.\c:\somedir\aux
[/quote]
To test the effect of such names, in NT/Win2000, right-click your desktop and make a 'New Text Document', and name it CON. You should get an error message telling you that the name you chose is 'invalid' and for you to choose another name for that text file.
--- --- ---
hawk
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|