nul
,con
,aux
,prn
,lpt
etc. Are reserved dos devices. When we try to create any file or folder with this name, we fail to create it and it results some kind of weird error.
But recently I ran the command md con\
in cmd and a directory named con
was created (not con\
)! I could normally copy and paste files in it, but when tried to delete it it resulted an error in windows explorer. But when I deleted that using command rd con\
it got deleted successfully.
I am wondering why we cannot create files or folders with these reserved names in windows explorer but CMD is successfully doing this?
md
command makes directories including intermediate directories. egmd c:\fldr1\fldr2\fldr3
will make all three folders so you told it to make one directory in a multi directory command format. Windows has rules for filenames so all programs can access all files. A program can opt in to less restrictive rules if its sure no other program needs access to the file. The NTFS file system will store files from any other operating system. It up to the OS making the files to enforce it's rules so its programs can read it.\\?\
. Sodir \\?\c:\windows
.