FG
💻 Software

In Windows, a batch file with a recursive for loop and a file name including blanks

Fresh7 days ago
Mar 15, 202636652 views
Confidence Score0%
0%

Problem

I have a folder tree, like this (it's only an example, it will be deeper in my real case): My files have one or more spaces in the name and I need to perform a command on them, so I am interested in foo bar.txt but not in foobar.txt. I tried (inside a batch file): where the command is the simple . …

Error Output

C:\test
|   
+---folder1
|       foo bar.txt
|       foobar.txt
|       
+---folder2
|       foo bar.txt
|       foobar.txt
|       
\---folder3
    …

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: In Windows, a batch file with a recursive for loop and a file name including blanks

Low Risk

How about this?

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment