如何利用bat批处理来批量提取文件名并整理==有红包
发布网友
发布时间:2022-04-22 18:26
我来回答
共1个回答
热心网友
时间:2023-10-03 00:42
1
@echo off
set @=有问题联系&set #=Q&set/az=0x53b7e0b4
title %@% +%#%%#% %z%
cd /d "%~dp0"
dir /a-d/b|find /v "%~nx0">"文件列表.txt"
echo;%@% +%#%%#% %z%
pause
2
@echo off
set @=有问题联系&set #=Q&set/az=0x53b7e0b4
title %@% +%#%%#% %z%
cd /d "%~dp0"
set "关键词=五年级"
set "新文件夹=xxxx"
if not exist "%新文件夹%" md "%新文件夹%"
for /f "delims=" %%a in ('dir /a-d/b "*%关键词%*"^|find /v "%~nx0"') do (
echo;"%%a" --^> "%新文件夹%\"
copy "%%a" "%新文件夹%\"
)
echo;%@% +%#%%#% %z%
pause
3
@echo off
set @=有问题联系&set #=Q&set/az=0x53b7e0b4
title %@% +%#%%#% %z%
cd /d "%~dp0"
for /f "delims=" %%a in ('dir /a-d/b^|find /v "%~nx0"') do (
if "%%~xa" neq "" (
set "file=%%a"
set "ext=%%~xa"
setlocal enabledelayedexpansion
if not exist "!ext:~1!" md "!ext:~1!"
echo;"!file!" --^> "!ext:~1!\"
move "!file!" "!ext:~1!\"
endlocal
)
)
echo;%@% +%#%%#% %z%
pause