0

i have bat file which is give me list of sub directory and it's file name but it export in notepad file and i need to rename all file name inside directory, so how can i get name of file in one bye one and rename it.

OR

is it possible to get inside directory do some action, back to main directory, then go to second directory and do same action again and so on....

I Need to edit name of files inside the directory so i need to get first name of that file make some modification into it's name and give it new name.

bat file for list of sub directory and files is below.

@echo off
setlocal disableDelayedExpansion
pushd %1
set "tab=    "
set "indent="
rem call :run >report.txt
exit /b

:run
for %%F in (.) do echo %%~fF

:listFolder
setlocal
set "indent=%indent%%tab%"
for %%F in (*) do echo %indent%%%~tF   %%F
for /d %%F in (*) do (
  echo %indent%.\%%F
  rem pushd "%%F"
  echo "%%F"
  rem call :listFolder
  popd
)
exit /b

0 Answers0