Skip to content

Instantly share code, notes, and snippets.

@kabilashgit
Last active April 29, 2024 16:03
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kabilashgit/c29a378e55c484e27f42ef4dcef10191 to your computer and use it in GitHub Desktop.
Save kabilashgit/c29a378e55c484e27f42ef4dcef10191 to your computer and use it in GitHub Desktop.
rename all files to lower-case in windows

Rename all files in the directory to lowercase

open command line in that direct and run the following command

for /f "Tokens=*" %f in ('dir /l/b/a-d') do (rename "%f" "%f")

replace all subfolder files to lowercase

for /f "Tokens=*" %g in ('dir /b') do (for /f "Tokens=*" %f in ('dir %~fg /l /b /a-d') do (rename "%~fg\%f" "%f"))

1 Replace "SPACES" with "DASH" in the folder

cmd /e:on /v:on /c "for %f in ("* *.jpg") do (set "n=%~nxf" & set "n=!n: =-!" & ren "%~ff" "!n!" )"
replace this ".jpg" (extension) and change the character in the bracket you want to replace "n=!n: =(-)!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment