@echo off
set BaseDir=c:\pics
set Hits=0
for /f %%A in ('dir /a-d /b /s "%BaseDir%\*%~1*.jpg"') do set /a Hits+=1
if %Hits% GTR 1 (
echo *** More than one matching file found ***
for /f %%A in ('dir /a-d /b /s "%BaseDir%\*%~1*.jpg"') do echo %%~fA
exit /b
)
for /f %%A in ('dir /a-d /b /s "%BaseDir%\*%~1*.jpg"') do (
mspaint "%%~fA"
)
|