Windows glitch?

Miscellaneous Forums/General Discussion/Windows glitch?

I read somewhere on the internet that you can't name a folder "con" (minus the quotes) on WinXP. I tried it and it reverts back to "New Folder". Does anyone know why it does this? Does Vista or earlier Windows OS's do it also?

Yes, because CON is a device name, like COM1 and LPT1, and all device names are reserved words for security reasons.

Oh. What kind of device is CON?

I'll hazard a guess but it is probably totlaly wrong, "CONsole"

IPete2.

Yep, it's console, although I had no idea about the folder naming thing.

Yep, indeed it is the console.

sod knows why the folder name CON has anything to do with the system console tho.

It's Windows - I gave up trying to apply any logic to it's workings, years ago. :)

If you do a copy command in a command prompt to CON, it will copy to the console. If you had a file or directory named con, the system wouldn't know which you were trying to copy to.

So, just to keep the problem from surfacing, device names are off limits for file or directories. Kind of like not being able to use keywords as variable names when programming.

Good point. My DOS is a tad rusty. :)

You learn something new everyday! :)

Dabz

Thanks everyone.

Those Devices can be called like files by the OS, that's why the names can't be used. Try this:

For example, you could open and close the LPT1 or COM1 (serial port) and read and write from/to a stream.


a=readfile("COM1")
print a
closefile a
waitkey()

This will open the serial port for standard communication.


Of course we all want those old DOS programs still function on vista, right? (I guess a lot of companies are still using DOS software)

So long as they are 32 bit apps, since 16 bit support has been ripped out of Vista ;]

As far as I see MSDOS is still supported, although there's only a virtual msdos, or a msdos emulation that may be based on 32 or 64 bits wich doesn't really matter.

real 16Bit dlls and apps are supported by vista 32bit that contains the 16bit emulation. In vista 64 bit this is missing.
In case you need it:
You may still use virtualpc: http://www.microsoft.com/windows/virtualpc/default.mspx
Or any other virtual machine that is supported by your hardware and allows to run 16 bit apps.