::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::åè½ç®ä»ï¼
::æ索并å¤å¶ä¸ä¸ªæå¤ä¸ªç£çä¸çæä¸ç±»å(åç¼å)çæ件
::æ索并å¤å¶ææ件夹åå
¶åæ件夹ä¸æç±»æ件
::æ件å°è¢«å¤å¶å°æ¬batæå¨ç®å½ä¸çä¸æ°å»ºæ件夹ä¸
::èªå¨éå½åååæ件ï¼é¿å
è¦ç
::èªå¨å建å¤å¶æ¸
åï¼è®°å½å¤å¶è·¯å¾ï¼ä»¥åéå½åæ件çåæ件ååæ°æ件å
::èªå¨è®¡ç®å¤å¶æ件æ°éï¼å¹¶ä¿åäºæ¸
åä¸ï¼æ¸
åä½äºbatæå¨ç®å½ã
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off&setlocal enabledelayedexpansion
title ãç±»æ件æåã ã ã ã æµè¯ç¯å¢ï¼ Windows XP SP3
SET HardDisK=C D E F G H I J K L M N O P
:str
color !time:~7,1!!time:~9,1!
set OUT=§&set REJ=&set DSK=&set DIS=&cls&set "LJ=%cd%"&echo.
echo âââ® â ï¹â®â â½â® oοÐâ ¤ è²å½©ä¸çæ³ï¼æ两次ENTERé®ï¼
echo ︶︶ (o"."o)(o-.-o) , ︶︶
echo â¤ï¿£ï¿£~~ï¹ï¸¸ï¿£ï¸¸ï¿£ï¸¸ï¿£ï¿£â¥â»â»â»â»â»â»â»â»â»â»â»â»â»â»â»â£
echo ( â â ââââæ¬æ¹å¤çå¯ç¨äºæ件å½ç±»åæ¡£ââââ â â )
echo ( â â â â )
echo ( â â æ件å°è¢«æ·è´å°æ¬æ¹å¤çæå¨ç®å½ä¸å¹¶å建æ¸
å â â )
echo ( â â â â )
echo ( â â ââ Byï¼å¾è
¾ 2011-03-29 â â )
echo â°â¥â»â»â»â»â»â»â»â»â»â»â£ï¼¿ï¼¿ï¼¿ï¼¿ï¼¿ï¼¿ï¼¿ï¼¿ï¼¿ï¼¿ï¼¿ï¼¿ï¼¿ï¼¿ï¼¿â¢
echo.
for %%i in (%HardDisK%) do (if exist %%i: (set DSK=!DSK! %%i))
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
echo â
å½åç£ç "!DSK! " ââ(请è¾å
¥ä¸éæç´¢çç£çç符)&echo.
echo (ä¾ï¼è¾å
¥"CEF",å³åªå¯¹CãEãF以å¤çç£çè¿è¡æç´¢åå¤å¶)&echo.
echo ä½ å¯ä»¥å°ç®æ æ件夹æå
¥æ¬çªå£ï¼åªå¨å
¶ç®å½ä¸æç´¢ããã
echo.&set/p OUT= (æå
¥æ件夹å°æ¬çªå£åéåå»çªå£ï¼åæENTERé®ç¡®è®¤)ï¼&cls
set err=0&set fd=0
if "!OUT!" neq "§" if exist !OUT! (
cd !OUT!||echo è·¯å¾ä¸æ£ç¡®ï¼ä¸è½å
å«æ件åï¼&&pause&&goto str
set fd=1&set DIS= !OUT!&goto Suffix)
for %%i in (!DSK!) do (
if /i "!OUT:%%i=!" equ "!OUT!" (set DIS=!DIS! %%i)
if /i "!OUT:%%i=!" neq "!OUT!" (set REJ=!REJ! %%i&set err=1))
if !err!==1 (set REJ=ï¼ä¸æç´¢ç"!REJ! ") else (set DIS=!DSK!)
:Suffix
color 3f&set SUF=&set err=0&echo.&echo.
if "!DIS!"=="" (color CF&set err=1&set DIS= 没æäºï¼è¿åå§ããã)
echo 确认æ索对象 "!DIS! " !REJ!&echo.
echo 请è¾å
¥æ件åç¼å(å¦ MP3ãTXTãDOCï¼ä¸åºå大å°å)&echo.
set/p SUF= ââ(ä¸è¾å
¥å
容æENTERé®è¿å)ï¼
if "!SUF!" neq "" set SUF=!SUF: =!
if "!SUF!"=="" (goto str)
if "!err!"=="1" goto str
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set ch=&set "tme="&set num=0&set "FL=*.!SUF!"
for /f "tokens=1,* delims=. " %%i in ('echo !SUF!') do (
if "%%j"=="" (set "SUF=!SUF:.=!"&set "FL=*.!SUF!" ) else (
echo.&set/p ch=æ¯è¦æç´¢æ件â!SUF!âåï¼ï¼Y/Nï¼[Y]ï¼
if /i "!ch!" neq "n" set "FL=!SUF!"))
if exist File_!SUF! (set ch=&echo.
set/p ch=âFile_!SUF!âå·²åå¨ï¼æ¯å¦æ¿æ¢ï¼ï¼Y/Nï¼[Y]ï¼
if /i "!ch!"=="n" (set tim=!time:.=!
set dat=!date:~0,10!&set dat=!dat:-=!
set "tme=_!dat!!tim::=!") else (
rd /s /q File_!SUF! 2>nul
del /q !SUF!_CopyList.TXT 2>nul))
md "!LJ!\File_!SUF!!tme!"&cls
set "FIL=!LJ!\File_!SUF!"&set "LIT=!LJ!\!SUF!_CopyList"
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
if %fd%==0 (
for %%i in (!DIS!) do ( CD/D %%i:&cd\&echo.
echo â£æ£å¨æç´¢ %%i çä¸ "%SUF%" æ件ããã
echo.&set cot=!num!&call :go)) else ( cd/d !DIS!
echo.&echo â£æ£å¨æç´¢!DIS!ä¸ "%SUF%" æ件ããã
echo.&set cot=!num!&call :go)
set ovr=!SUF!æ件æ»æ°:!num! æ¥æ:%date% %time:~0,8%
(echo.&echo ââ%ovr%)>>"!LIT!!tme!.TXT"
if !num!==0 ( rd /s /q "!FIL!!tme!" 2>nul
del /q "!LIT!!tme!.TXT" 2>nul
echo.&echo æ æ¤ç±»åæ件ï¼&echo.)
color 31&echo.
if !num! neq 0 (echo å·²å¤å¶å°ï¼"!FIL!!tme!"
echo å¤å¶æ¸
åï¼"!LIT!!tme!.TXT"&echo.)
echo å¤å¶æ件æ»æ°ï¼!num!ï¼æä»»æé®è¿å...
pause>nul&cls&cd/d !LJ!&goto Suffix
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::éæ¸
åæ件?>>æ·è´è·¯å¾ä¸ºä¸ä¸ºåæ¾è·¯å¾?>>éå?[éå½åé¢è®¾]>>æå
:go
for /f "delims=" %%j in ('dir /a /s /b !FL!') do (
set "lst=%%~nxj"&set "cpf=%%~dpj"
if "!lst:_CopyList=!"=="!lst!" (
if "!cpf:File_=!"=="!cpf!" (
set rne=&set rea=&set rna=â
if exist "!FIL!!tme!\%%~nxj" (
set tim=!time:.=!&set tim=!tim::=!
set rna=â&set rea= â
éå½åï¼"%%~nj-â!tim!%%~xj"
set "rne=\%%~nj-â
!tim!%%~xj")
COPY /y "%%j" "!FIL!!tme!!rne!" >nul
echo !rna!å·²å¤å¶ï¼"%%j"&set/a num+=1
echo !rna!"%%j"!rea!>>"!LIT!!tme!.TXT")))
set/a cot=!num!-!cot!
echo.&echo %cd%ç®å½ä¸å¤å¶!SUF!æ件æ°ï¼!cot! "â"表示已éå½åæ件
echo ==============================================================
goto :eof
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
温馨提示:答案为网友推荐,仅供参考