On Windows file names like com1.txt or lpt1.txt are forbidden. Is there a list of all forbidden file and folder names on windows (or forbidden chars in the file and folder n
The list of invalid characters is:
Plus characters 1 to 31
Source
But you should use System.IO.Path.GetInvalidFileNameChars
and System.IO.Path.GetInvalidPathChars
(or their equivalents) as recommended by FlipScript as a) it's neater and b) means that if the list ever changes you won't have to modify your application.
A list of reserved device names:
http://www.blindedbytech.com/2006/11/16/forbidden-file-and-folder-names-on-windows/
You didn't mention what platform you are using, but in .Net, you can use:
System.IO.Path.GetInvalidFileNameChars
and
System.IO.Path.GetInvalidPathChars
To return invalid file name and path characters.