小编The*_*der的帖子

如何在批处理文件中为文件夹中的每个文件随机生成名称?

我想将文件夹中的所有文件重命名为随机名称,但它想将所有文件重命名为相同的名称:

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)

windows random cmd batch-file file-rename

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

batch-file ×1

cmd ×1

file-rename ×1

random ×1

windows ×1