@echo off && setlocal DisableDelayedExpansion :: [バッチに投げた複数ファイル/フォルダ群] に含まれる譜面数を算出 :: 単体で使うなら exit /b の前の空行に pause を追加すること :: 2010/09/10 諸事情で !遅延展開! やめ :: ******************** config ******************** :: set BMC="C:\Documents and Settings\UserName\SendTo" :: ************************************************ set /a CNT=0 :count set FLD=%~1\ if .%1==. ( call echo BMx : %%CNT%% File^(s^) Found. if %CNT%==0 ( endlocal echo The Batch Processing is Discontinued. pause exit ) else ( echo: endlocal echo: exit /b ) ) if not exist "%FLD%" ( if /i "%~x1" == ".bms" goto single if /i "%~x1" == ".bme" goto single if /i "%~x1" == ".bml" goto single if /i "%~x1" == ".pms" goto single ) for /r %1 %%A in (*.bms *.bme *.bml *.pms) do ( call set /a CNT=%%CNT%%+1 call echo No.%%CNT%% : %%~nxA ) shift goto count :single call set /a CNT=%%CNT%%+1 call echo No.%%CNT%% : %~nx1 shift goto count