博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
从指定路径下的N首歌曲随机复制到指定名字的M首歌曲
阅读量:5090 次
发布时间:2019-06-13

本文共 690 字,大约阅读时间需要 2 分钟。

@echo off

setlocal ENABLEDELAYEDEXPANSION
set path=%~dp0
set filename=!path!mp3.tmp
if "%1" equ "" (
echo ERROR_NO_PARAMETER
goto finished
)

set rand_switch=0

if "%2" equ "rand-on" (
set rand_switch=1
)

pushd %1 0>NUL 1>NUL 2>NUL

if ERRORLEVEL 1 (
echo can't find %1 folder
goto finished
)
dir /b /s *.mp3>!filename!
set cnt=10
:go
if !cnt! lss 100 (
if !rand_switch! equ 1 (
if exist !path!rearrange_file.exe (
!path!rearrange_file.exe !filename!
)
)
for /f "delims=" %%i in (!filename!) do (
copy %%i !path!\!cnt!.mp3
set /a cnt=!cnt!+1
if !cnt! geq 100 goto finished
)
goto go
)
:finished
if exist !filename! del !filename!
popd
pause

转载于:https://www.cnblogs.com/authorlcy/p/5428375.html

你可能感兴趣的文章