早在 MS-DOS 时代,“con”就有特殊的含义。 它引用控制台,并允许您像对待任何其他文件一样对待它。 例如,您可以通过输入 copy con new.txt 创建一个新的文本文件。 然后您可以输入文本并在完成后点击^Z。
问题是,你仍然可以这样做。 因此,就文件系统而言,已经存在一个名为 con 的对象。 还有其他保留名称,但我看到输入这些名称已在其他答案中提供。
Back in the MS-DOS days, "con" had a special meaning. It referred to the console, and allowed you to treat it like any other file. For example, you might create a new text file by typing copy con new.txt. Then you could enter your text and hit ^Z when finished.
The thing is, you can still do that. Therefore, as far as the file system is concerned there is already an object out there named con. There are other reserved names as well, but I see that while typing this those names have been provided already in other answers.
这可以追溯到 MS-DOS。 读取或写入名为“CON:”的文件从控制台读取/写入。 我想 Windows 仍然支持这一点以实现向后兼容性。
This dates back to MS-DOS. Reading or writing to a file named "CON:" read/wrote from the console. I imagine Windows is still supporting this for backwards compatibility.
发布评论
评论(5)
早在 MS-DOS 时代,“con”就有特殊的含义。 它引用控制台,并允许您像对待任何其他文件一样对待它。 例如,您可以通过输入
copy con new.txt
创建一个新的文本文件。 然后您可以输入文本并在完成后点击^Z
。问题是,你仍然可以这样做。 因此,就文件系统而言,已经存在一个名为
con
的对象。 还有其他保留名称,但我看到输入这些名称已在其他答案中提供。Back in the MS-DOS days, "con" had a special meaning. It referred to the console, and allowed you to treat it like any other file. For example, you might create a new text file by typing
copy con new.txt
. Then you could enter your text and hit^Z
when finished.The thing is, you can still do that. Therefore, as far as the file system is concerned there is already an object out there named
con
. There are other reserved names as well, but I see that while typing this those names have been provided already in other answers.来源:MSDN
其他名称,例如驱动器名称,也不能使用:
来源:Microsoft 支持
Source: MSDN
Other names, such as drive names, cannot be used as well:
Source: Microsoft support
实际上,您可以将该文件夹重命名为
con
在命令提示符中使用此命令,这会在您的 C: 驱动器上创建一个名为
con
的系统文件夹,要删除此文件夹,您需要使用此文件夹在命令提示符下
,仅供那些想知道“那你为什么要这样做?”的人使用? - 我的名字是 CON,如果我想用它作为我的文件夹,我会“麻烦你 MS”
Con “OzDing”
Actually you can rename the folder to
con
use this in the command prompt and this creates a system folder named
con
on your C: Driveto remove this folder you need to use this in the command prompt
And just for those that are wondering "so why would you?" - my name is CON and if I wish to use that as my folder I WILL so "bugger you MS"
Con "OzDing"
这可以追溯到 MS-DOS。 读取或写入名为“CON:”的文件从控制台读取/写入。 我想 Windows 仍然支持这一点以实现向后兼容性。
This dates back to MS-DOS. Reading or writing to a file named "CON:" read/wrote from the console. I imagine Windows is still supporting this for backwards compatibility.
来自 Microsoft TechNet:
From Microsoft TechNet: