Windows 和重命名文件夹,“con” 问题

发布于 2024-07-11 03:56:21 字数 1459 浏览 4 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

对你的占有欲 2024-07-18 03:56:21

早在 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.

南渊 2024-07-18 03:56:21

请勿使用以下保留设备名称作为文件名:

CON、PRN、AUX、NUL、COM1、COM2、COM3、COM4、COM5、COM6、COM7、COM8、COM9、LPT1、LPT2、LPT3、LPT4、LPT5、LPT6、LPT7、LPT8 和 LPT9

来源:MSDN

其他名称,例如驱动器名称,也不能使用:

时钟$,A:-Z:

来源:Microsoft 支持

Do not use the following reserved device 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

Source: MSDN

Other names, such as drive names, cannot be used as well:

CLOCK$, A:-Z:

Source: Microsoft support

冷︶言冷语的世界 2024-07-18 03:56:21

实际上,您可以将该文件夹重命名为 con

在命令提示符中使用此命令,这会在您的 C: 驱动器上创建一个名为 con 的系统文件夹,

md \\\\\.\\\C:\con

要删除此文件夹,您需要使用此文件夹在命令提示符下

rd/s \\\\.\\\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: Drive

md \\\\\.\\\C:\con

to remove this folder you need to use this in the command prompt

rd/s \\\\.\\\C:\con

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"

活泼老夫 2024-07-18 03:56:21

这可以追溯到 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.

丑疤怪 2024-07-18 03:56:21

来自 Microsoft TechNet

几个特殊文件名是系统保留的,不能用于文件或文件夹:

CON、AUX、COM1、COM2、COM3、COM4、
LPT1、LPT2、LPT3、PRN、NUL

From Microsoft TechNet:

Several special file names are reserved by the system and cannot be used for files or folders:

CON, AUX, COM1, COM2, COM3, COM4,
LPT1, LPT2, LPT3, PRN, NUL

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文