batch rename folder
REM # | EXAMPLE (changes the ChangeMyName folder's name to NameChanged)
rename "C:/Users/JacquesK/ChangeMyName" "NameChanged"
REM # | SYNTAX
REM # | rename "<folder-to-change-the-name-of>" "<new-folder-name>"REM # (1) Rename folders (not files) in the current folder only
REM # (2) Rename folders (not files) in the current folder and its subfolders
REM # | EXAMPLE (1)
REM # | ---------------------------------------------------------------
REM # | Replace " " with "_" for the folders in the current folder only
@echo off
setlocal EnableDelayedExpansion
set "pattern_to_replace= "
set "replace_text=_"
for /d %%N in ("*") do (
set "InitName=%%N"
call set NewName=%%InitName:!pattern_to_replace!=!replace_text!%%
if NOT !InitName!==!NewName! (
echo rename "!InitName!" "!NewName!"
rename "!InitName!" "!NewName!"
)
)
@echo on
REM # | EXAMPLE (2)
REM # | ---------------------------------------------------------------
REM # | Replace " " with "_" for the folders in the current folder and all its subfolders
@echo off
setlocal EnableDelayedExpansion
set "pattern_to_replace= "
set "replace_text=_"
for /d /R "%cd%" %%N in ("*") do (
set "InitName=%%~nN%%~xN"
call set NewName=%%InitName:!pattern_to_replace!=!replace_text!%%
if NOT %%N==%%~dN%%~pN!NewName! (
echo rename "%%~dN%%~pN!InitName!" "!NewName!"
rename "%%~dN%%~pN!InitName!" "!NewName!"
)
)
@echo on
REM # | ---------------------------------------------------------------
Also in C++:
- install yarn ubuntu 20.04
- how to resolve failing tests after database migration
- Error: .ini file does not include supervisorctl section
- pip reinstall
- view lubuntu-desktop from another computer
- git reset initial commit
- extract ip address from string powershell pattern
- cursor size in linux not changing on the desktop
- unzip ubuntu
- automate tmux
- rename a running docker container
- install fzf redhat 8
- regex all not numbers
- giga git commands
- new ip linux
- linux copy folder with files
- I want to give a specific color to git
- git push f head
- git fetch rebase
- how to connect ssh to virtualbox ubuntu
- react print
- how to move file from one directory to another in linux
- ubuntu delete directory and all files
- git remove tracked files without deleting