News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_HAL6128

Windows 11 forbidden folder names due to CP/M ?

Started by HAL6128, 14:49, 28 March 24

Previous topic - Next topic

0 Members and 8 Guests are viewing this topic.

HAL6128

Today I faced something new... maybe you know already know it?
If you want to create in Windows 11 (maybe also in 10,8,7, etc.) a folder name like:
CON, AUX, LST, PRN, NUL, EOF, INP, OUT
...then you will get a error message >> not allowed.

This derived from CP/M (assuming by some people in the net).

Funny thing it is, isn't it? 

(...going to test this on SymbOS ;D )

[left][code]CON: — console (input and output)
AUX: — an auxiliary device. In CP/M 1 and 2, PIP used PUN: (paper tape punch) and RDR: (paper tape reader) instead of AUX:
LST: — list output device, usually the printer
PRN: — as LST:, but lines were numbered, tabs expanded and form feeds added every 60 lines
NUL: — null device, akin to /dev/null
EOF: — input device that produced end-of-file characters, ASCII 0x1A
INP: — custom input device, by default the same as EOF:
OUT: — custom output device, by default the same as NUL:
[/left]

[/code]
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

cwpab

Just tested in Windows 10, no luck.  :'(

GUNHED

Pretty far fetched to blame CP/M for a Windows 11 symptome.
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Gryzor

Heh I had read about it, funny stuff :D

Funny thing, Explorer will not let me create them under my Windows 11 Pro, however I *can* do it with Directory Opus. What's more Explorer can read them fine. So it's probably something buried within the Explorer code rather than the system.

MaV

Yes, these safety precautions are still in place, and will be for as long as you can execute (ancient) batch files in the cmd shell. Some of these are still useful like NUL (try dir > nul), because it prevents text output when not needed.

Imagine having a directory or file named like that and executing an old batch file that uses one of those names. You'll most probably destroy your original directory or file unintentionally doing that.

And yes, Windows Explorer handles this, just like it did limit file name length in Windows to 256 characters (including the path name) for historical reasons. (Oh, the joyous moments when you copied files via Explorer from directories which have longer names!)
Interestingly enough, the NTFS as such is completely ok with any of that. It's for legacy reasons that Windows cripples is functionality.

It is a remnant from MS-DOS days which in itself is based on QDOS which is derived from CP/M.
Black Mesa Transit Announcement System:
"Work safe, work smart. Your future depends on it."

andycadley

Quote from: GUNHED on 15:30, 28 March 24Pretty far fetched to blame CP/M for a Windows 11 symptome.
It's not really blaming CP/M, it's just a historic fact. MSDOS took the concept from CP/M to preserve compatibility, Windows inherited it from DOS to maintain compatibility....

cwpab

Is there any possible explanation to why this happens in Windows 11, but not in Windows 10? (Maybe I should try creating a folder with those names from the CLI?)

I mean, if they are supposedly "dragging" this from 35 years ago, shouldn't this also be an issue in ALL versions of Windows and not just in 11?

andycadley

Quote from: cwpab on 18:50, 28 March 24Is there any possible explanation to why this happens in Windows 11, but not in Windows 10? (Maybe I should try creating a folder with those names from the CLI?)

I mean, if they are supposedly "dragging" this from 35 years ago, shouldn't this also be an issue in ALL versions of Windows and not just in 11?
It does happen in all versions of Windows. I think the NT line always had ways of getting around it if you really wanted to create yourself headaches (using NTFS native paths for example) but Explorer always had a prompt to block you.

Every now and again someone "discovers" this and thinks it's a new thing.

cwpab

I'm using Windows 10 Enterprise LTSB (yeah, I pirated a special educational copy to get rid of all the crap, which is not included here) and when I create a folder named "OUT", there is no error message.

It would be interesting to try in some Windows 3.11 and Windows 95 emulators I have on my DBGL MS-DOS game collection, though... Hmmm.

EDIT: Okay, it seems that only "CON", "AUX" and "PRN" are forbidden in my Windows 10. Cool stuff!

cwpab

I have already accidentally written this double message, so...

According to Microsoft..
" These folder can't be created on the desktop as they refer to "System Action" or "Device" and are reserved for tasks to be performed by Windows. Here are other folders that cannot be created:
CON, PRN, AUX, CLOCK$, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9,
LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9 "

Bryce

#10
Slightly interesting, but absolutely nothing to do with CP/M. This is just to avoid security loopholes in script based languages / SQL code injection hacks. It has always existed, but the list seems to get longer with each Win version.

Bryce.

Prodatron

Quote from: HAL6128 on 14:49, 28 March 24AUX: — an auxiliary device. In CP/M 1 and 2, PIP used PUN: (paper tape punch) and RDR: (paper tape reader) instead of AUX:
LST: — list output device, usually the printer
PRN: — as LST:, but lines were numbered, tabs expanded and form feeds added every 60 lines
NUL: — null device, akin to /dev/null
EOF: — input device that produced end-of-file characters, ASCII 0x1A
INP: — custom input device, by default the same as EOF:
OUT: — custom output device, by default the same as NUL:
[/left]

[/code]

Is this from CP/M itself (until 2.2)?
Wasnt this only used by PIP? At least the BDOS doesnt have any clue about these strings. Maybe later CCP of CP/M plus as well? But MSDOS/QDOS was 2.2 based Not 3.x. So yes Bryce is right, this has nothing really to do with CP/M imho, just the naming.

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

andycadley

Quote from: Bryce on 19:52, 28 March 24Slightly interesting, but absolutely nothing to do with CP/M. This is just to avoid security loopholes in script based languages / SQL code injection hacks. It has always existed, but the list seems to get longer with each Win version.

Bryce.
Nah, it goes all the way back to DOS:

https://devblogs.microsoft.com/oldnewthing/20031022-00/?p=42073

And DOS inherited the idea from CP/M, just as it did various other bits and pieces like 8.3 filenames.

ZorrO

I had no idea about this forbiden name. But my W10 when I try made catalog CP/M doing cat CP and cat M inside of CP.
CPC+PSX 4ever

Prodatron

Quote from: HAL6128 on 14:49, 28 March 24(...going to test this on SymbOS ;D )

SymbOS isn't biased at all ;D

You cannot view this attachment.

It would did this on a mounted Windows FAT partition in WinApe, at least this was possible in the past.

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

andycadley

Quote from: Prodatron on 23:53, 28 March 24It would did this on a mounted Windows FAT partition in WinApe, at least this was possible in the past.
It's been a long time, but I think this is only a shell level block on NT based OS, i.e. Explorer or the Common File Dialogue). Directly creating files via the API and it'll just let you do whatever.

That's because it's not really a "security" thing, it's just trying to stop you getting into a situation where weird things happen if you run a command line task (either directly or via some GUI tool that just shells out to command line utilities).

I think it was different on DOS based Windows, because there things were more closely tied to how the command prompt works. NT doesn't really care, the command line is just an application like everything else.

Powered by SMFPacks Menu Editor Mod