@echo off
set /p x=Please enter the filename, pay attention to case:
for %%i in (C D E F ) do (
for /f %%a in ('dir %%i:\ /s/b^|find "%x%"') do (
set b=%%~ftza
)
)
for /f "tokens=1-4" %%a in ("%b%") do (
set f=%%a
set g=%%b
set e=%%c
set h=%%d
)
echo The file has been found!
echo File size is %e%KB
echo File modification time is %f% %g%
echo File path is %h%%x%
pause>nul
I wrote this myself. It's rather cumbersome, so I hope you experts will go easy on me. Right now there is one problem: when the path of the file you're searching for contains Chinese characters or spaces, it errors out... Can anyone help me solve this?
set /p x=Please enter the filename, pay attention to case:
for %%i in (C D E F ) do (
for /f %%a in ('dir %%i:\ /s/b^|find "%x%"') do (
set b=%%~ftza
)
)
for /f "tokens=1-4" %%a in ("%b%") do (
set f=%%a
set g=%%b
set e=%%c
set h=%%d
)
echo The file has been found!
echo File size is %e%KB
echo File modification time is %f% %g%
echo File path is %h%%x%
pause>nul
I wrote this myself. It's rather cumbersome, so I hope you experts will go easy on me. Right now there is one problem: when the path of the file you're searching for contains Chinese characters or spaces, it errors out... Can anyone help me solve this?

