I've never created or used batch files before so be gentle with me?
I have a large hard drive containing around 400 sub-directories. Each sub-directory contains two or three files. It is these files I wish to modify. The current sub-directory files have spaces within their file names. The new system I'm moving the files to requires that all file names use full stops as separators rather than spaces. The code below works fine when the batch file is in the same directory as the files. I need it to process the sub-directories too. Any ideas anyone?
My testing directory is on the desktop and called "testing".
Code: Select all
@echo off
setlocal enabledelayedexpansion
for %%a in ("* *") do (
set "file=%%a"
ren "%%a" "!file: =.!"
)