Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 为什么驱动器号没有资本化_Batch File_Directory_Cd_Capitalization_Drive Letter - Fatal编程技术网

Batch file 为什么驱动器号没有资本化

Batch file 为什么驱动器号没有资本化,batch-file,directory,cd,capitalization,drive-letter,Batch File,Directory,Cd,Capitalization,Drive Letter,在批处理中,当我换成另一个大写的驱动器时,它会自动更正除fr以外的所有内容的大写。当我要换的新驱动器与我当前所在的驱动器相同时,除fr以外的驱动器号。与此类似(这只是一个演示示例): 那么,为什么驱动器号的大小写行为是这样的呢?我不知道这有什么关系,但我以前注意到过这种行为 我不知道答案,但我可以做出有根据的猜测 文件夹名称的大小写存储在卷的目录中,因此CD命令只使用目录中的大小写,而忽略实际输入的内容。但是我不认为卷号存储在卷的目录中,因此CD命令只保留输入的驱动器号大小写。我想驱动器号只存在

在批处理中,当我换成另一个大写的驱动器时,它会自动更正除fr以外的所有内容的大写。当我要换的新驱动器与我当前所在的驱动器相同时,除fr以外的驱动器号。与此类似(这只是一个演示示例):


那么,为什么驱动器号的大小写行为是这样的呢?

我不知道这有什么关系,但我以前注意到过这种行为

我不知道答案,但我可以做出有根据的猜测


文件夹名称的大小写存储在卷的目录中,因此CD命令只使用目录中的大小写,而忽略实际输入的内容。但是我不认为卷号存储在卷的目录中,因此CD命令只保留输入的驱动器号大小写。

我想驱动器号只存在,没有定义的大写。
您只能看到
cd
pushd
popd
命令的最后一个影响

这些命令仅在新目录与以前不同时才影响目录

cd c:\
cd c:\windows  - Affects the directory and therefore the drive letter case
pushd C:\windows - doesn't affect the current directory
cd ..
popd - Affects the directory and therefore the drive letter case

您使用的是哪个平台?@aschipfl-根据StackOverflow的定义,[batch file]标记意味着Windows。“代码”中的提示将列出
C:\Windows\System32
文件夹。“平台是什么,这不是很明显吗?”辣椒-这有什么关系?除非执行区分大小写的字符串比较,否则它对功能没有影响。但是Windows路径不区分大小写,所以所有路径字符串比较都应该不区分大小写。@dbenham,实际上我想知道OP使用的是哪个Windows版本…@aschipfl-据我所知,至少从XP开始,所有Windows版本上都是这样。
cd c:\
cd c:\windows  - Affects the directory and therefore the drive letter case
pushd C:\windows - doesn't affect the current directory
cd ..
popd - Affects the directory and therefore the drive letter case