I am writing a file to remove spaces from filenames in a folder and then put the result in a .txt file. I just get a result of \"Echo is on.\" over and over.
Run the following batch in the folder holding the files to be renamed
@echo off
setlocal enabledelayedexpansion
for %%j in (*.*) do (
set filename=%%~nj
set filename=!filename=.=_!
set filename=!filename= =_!
if not "!filename!"=="%%~nj" ren "%%j" "!filename!%%~xj"
)
you just need to add the print to txt