xxxxxxxxxx
@echo off
Setlocal enabledelayedexpansion
Set "Pattern= "
Set "Replace=_"
For %%a in (*.exe) Do (
Set "File=%%~a"
Ren "%%a" "!File:%Pattern%=%Replace%!"
)
Pause&Exit
xxxxxxxxxx
Get-ChildItem C:\NewFolder -Directory -Recurse | Rename-Item -NewName {$_.Name -replace '_',' '}
xxxxxxxxxx
string_with_underscore = "hello_world"
string_with_space = string_with_underscore.replace("_", " ")
print(string_with_space)