dos - batch file for loop with spaces in dir name - Stack Overflow
If you don't want to deal with "quotes" you can use the "s" switch in %~dpnx[]... this will output the short filenames that are easy to work with. from the Command line... for /f "delims=" %f IN ('dir /b /s "C:\Program Files\*.dll"') do echo %~sdp...