我想将文件夹中的所有文件重命名为随机名称,但它想将所有文件重命名为相同的名称:
ren "c:\Test\*.txt" %Random%.txt
pause
Run Code Online (Sandbox Code Playgroud)
输出:
C:\Users\Oliver\Desktop>ren "c:\Test\*.txt" 9466.txt
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
A duplicate file name exists, or the file
cannot be found.
C:\Users\Oliver\Desktop>pause
Press any key to …Run Code Online (Sandbox Code Playgroud)