Welcome to WebmasterWorld Guest from 23.20.8.182

Forum Moderators: bill

Message Too Old, No Replies

List of FileNames reserved exclusively for Windows Operating System

There are certain filenames which we cannot create...

     
4:28 pm on Oct 20, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 3, 2003
posts:961
votes: 0


Hello,

Is there a list of filenames which are exclusively reserved for windows OS.

I am creating files using a software and one such file was "con". However the software gave an error and when I tried to create that file manually, it gave an error. For example, try creating a file "con" on your PC and you won't be able to create it.

Is there any function in Visual Basic which automatically derives such a list and not create those files, so that the software can proceed without any errors.

Also, is there such a list available so I can manually add them to my software coding.

There is a small list available here: [en.wikipedia.org...] Any more?

[edited by: Imaster at 4:31 pm (utc) on Oct. 20, 2006]

6:16 pm on Oct 20, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member kaled is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 2, 2003
posts:3710
votes: 0


This is NOT definitive...

CON, AUX, COM1, COM2, COM3, COM4, LPT1, LPT2, LPT3, PRN, NUL

I would be more general and disallow COM0..COM9 and LPT0..LPT9

Kaled.

11:13 pm on Oct 20, 2006 (gmt 0)

Administrator from JP 

WebmasterWorld Administrator bill is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Oct 12, 2000
posts:14791
votes: 86


Here's what Microsoft says about: Naming a file [msdn.microsoft.com]:
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
.