It's known, you can't create a file with name con
(con.txt
for example) in Windows.
So, in my application user can input a custom file name (not via SaveFileDialog, just textbox to input name, not full path), and I want to show an error message, when user inputs invalid file name.
Is there a way to get full list of reserved Windows file names (con
, prn
, lpt
and so on)?
Do not use the following reserved 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 immediately by an extension; for example, NUL.txt is not recommended.
As per: https://msdn.microsoft.com/en-gb/library/windows/desktop/aa365247(v=vs.85).aspx
Take a look here: Reserved file names
Reserved filenames in Windows operating systems
aux con clock$ nul prn com1 com2 com3 com4 com5 com6 com7 com8 com9 lpt1 lpt2 lpt3 lpt4 lpt5 lpt6 lpt7 lpt8 lpt9
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With