Skip to content

Instantly share code, notes, and snippets.

@Debcharon
Created April 1, 2024 15:37
Show Gist options
  • Save Debcharon/b369f549c1fcd681425b920ee73e49e1 to your computer and use it in GitHub Desktop.
Save Debcharon/b369f549c1fcd681425b920ee73e49e1 to your computer and use it in GitHub Desktop.
Get the folder name and replace spaces with underline on Windows
REM Get the folder name and replace spaces with underline
for /f "tokens=*" %%i in ("%folderPath%") do (
set "folderName=%%~nxi"
set "newFolderName=!folderName: =_!"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment