我需要重命名文件的帮助。在VLC中,它们显示如下:
Beginner PHP Tutorial - 1 - Introduction to PHP.p4
Beginner PHP Tutorial - 10 - print.mp4
Beginner PHP Tutorial - 100 - Creating a simple contact form Part 1.mp4
Beginner PHP Tutorial - 101 - Creating a Simple Contact Form Part 2.mp4
Etc...
Beginner PHP Tutorial - 199 - Connecting to a Database the OOP Way.mp4
Beginner PHP Tutorial - 2 - Installing XAMPP Part 1.mp4
Beginner PHP Tutorial - 20 - Assignment Operators.mkv
Beginner PHP Tutorial - 200 - Final PHP Video!!!.mp4
Beginner PHP Tutorial - 21 - Comparison Operators.mp4
Etc...
我希望视频按数字从1到200列出
我不知道如何使用CMD.exe来执行此操作,但是我确定这就是需要的内容。
我没有代码可以帮助。抱歉。我所知道的是CMD可以做到这一点。
我希望文件被这样列出:
Beginner PHP教程-1-PHP.mp4简介
初学者PHP教程-2-安装XAMPP第1.mp4部分
等等...
答案 0 :(得分:0)
以下批次使用
" - # - "
," - ## - "
Pad
字符重命名,:: Q:\Test\2019\05\09\SO_56049247.cmd
@Echo off
Set "Pad= "
for /l %%L in (1,1,9) do for %%A in ("* - %%L - *"
) Do call :Sub "%%~A" " - %%L - " " - %Pad%%%L - "
Set "Pad= "
for /l %%L in (10,1,99) do for %%A in ("* - %%L - *"
) Do call :Sub "%%~A" " - %%L - " " - %Pad%%%L - "
Goto :Eof
:Sub
Set "File=%~1"
Call Set "NewName=%%File:%~2=%~3%%"
Echo Ren %1 "%NewName%"
Ren %1 "%NewName%"
Goto :Eof
上述样本的输出:
Beginner PHP Tutorial - 1 - Introduction to PHP.mp4
Beginner PHP Tutorial - 2 - Installing XAMPP Part 1.mp4
Beginner PHP Tutorial - 10 - print.mp4
Beginner PHP Tutorial - 20 - Assignment Operators.mkv
Beginner PHP Tutorial - 21 - Comparison Operators.mp4
Beginner PHP Tutorial - 100 - Creating a simple contact form Part 1.mp4
Beginner PHP Tutorial - 101 - Creating a Simple Contact Form Part 2.mp4
Beginner PHP Tutorial - 199 - Connecting to a Database the OOP Way.mp4
Beginner PHP Tutorial - 200 - Final PHP Video!!!.mp4