batch to rename dir / sudir and files
Posted: 09 Jul 2019 05:18
good morning,
i am from portugal if you dont understand anithing please tryed to contact-me.
i have this batch file...but this do not renames the directories and the subdirectories, only the files.
can anyone help me?
thanks
i am from portugal if you dont understand anithing please tryed to contact-me.
i have this batch file...but this do not renames the directories and the subdirectories, only the files.
can anyone help me?
Code: Select all
@echo off
:again
echo Enter valid entry from the below options
SET /P OPT=Which option would you like? 1) Lower 2) Upper 3) Exit
IF %OPT%==1 GOTO :Lower
IF %OPT%==2 GOTO :Upper
IF %OPT%==3 GOTO :Exit
GOTO :again
:Lower
REM "@echo off
echo Enter the directory.
echo.
set /p "dir="
pushd "%dir%"
for /f "delims=" %%i in ('"dir /a-d/b/l 2>nul"') do ren "%%i" "%%i"
popd
exit /b"
:Upper
REM "@echo off
echo Enter the directory.
echo.
set /p "dir="
pushd "%dir%"
for /f "tokens=* delims=- " %%i in ('for /f "delims=" %%j in ^('"dir /a-d/b 2>nul"'^) do @find "" "%%j"') do ren "%%i" "%%i"
popd
exit /b"
:Exit
Exit
Top