for file in *; do mv "$file" `echo $file | tr ' ' '_'` ; done
find . -type f -name "* *" -exec bash -c 'mv "$0" "${0// /_}"' {} ;
for file in *; do mv "$file" $(echo $file | tr ' ' '_') ; done
@echo off
Setlocal enabledelayedexpansion
Set "Pattern= "
Set "Replace=_"
For %%a in (*.exe) Do (
Set "File=%%~a"
Ren "%%a" "!File:%Pattern%=%Replace%!"
)
Pause&Exit