建立适当大小写的文件名
Establishing Proper-Case filenames
如果我有一个名为 'This Is A File.TXT' 的文件,我如何在 Windows 10 中使用 CMD 重命名它以便改变大小写?
我在几千个文件上使用 Excel 并生成一个 CMD 脚本。
但是文件名的大小写没有改变。
我什至尝试将其重命名为 'SS This is a File.txt'(有效),但是当我将其从这个重命名为 'This is a File.txt' 时,它恢复为大写的文件名。
@ECHO OFF
SETLOCAL
SET "targetdir=C:\destdir"
SET "fromname=This Is A File.TXT"
SET "toname=This is a File.txt"
COPY NUL "%targetdir%\%fromname%"
DIR "%targetdir%\this*"
REN "%targetdir%\%fromname%" "%toname%"
DIR "%targetdir%\this*"
GOTO :EOF
已制作
Volume in drive C has no label.
Volume Serial Number is 830B-46FA
Directory of C:\destdir
15/04/2017 12:45 0 This Is A File.TXT
1 File(s) 0 bytes
0 Dir(s) 82,069,901,312 bytes free
Volume in drive C has no label.
Volume Serial Number is 830B-46FA
Directory of C:\destdir
15/04/2017 12:45 0 This is a File.txt
1 File(s) 0 bytes
0 Dir(s) 82,069,901,312 bytes free
对我来说,在 NTFS 和 USB 驱动器上,所以它似乎工作。
如果我有一个名为 'This Is A File.TXT' 的文件,我如何在 Windows 10 中使用 CMD 重命名它以便改变大小写?
我在几千个文件上使用 Excel 并生成一个 CMD 脚本。 但是文件名的大小写没有改变。
我什至尝试将其重命名为 'SS This is a File.txt'(有效),但是当我将其从这个重命名为 'This is a File.txt' 时,它恢复为大写的文件名。
@ECHO OFF
SETLOCAL
SET "targetdir=C:\destdir"
SET "fromname=This Is A File.TXT"
SET "toname=This is a File.txt"
COPY NUL "%targetdir%\%fromname%"
DIR "%targetdir%\this*"
REN "%targetdir%\%fromname%" "%toname%"
DIR "%targetdir%\this*"
GOTO :EOF
已制作
Volume in drive C has no label.
Volume Serial Number is 830B-46FADirectory of C:\destdir
15/04/2017 12:45 0 This Is A File.TXT
1 File(s) 0 bytes
0 Dir(s) 82,069,901,312 bytes free
Volume in drive C has no label.
Volume Serial Number is 830B-46FADirectory of C:\destdir
15/04/2017 12:45 0 This is a File.txt
1 File(s) 0 bytes
0 Dir(s) 82,069,901,312 bytes free
对我来说,在 NTFS 和 USB 驱动器上,所以它似乎工作。