Why does this batch script work...
@echo off
for /F %%a in ('dir /b F:\Temp\*.txt') do set TestFileName=%%~nxa
echo %FileName%
pause
But this one does not...
@echo off
for /F "usebackq" %%a in ('dir /b "F:\Temp Folder\*.txt"') do set TestFileName=%%~nxa
echo %FileName%
pause
I know that it has something to do with the double quotes that I am using due to the spaces in the folder name. But even after hours of searching the web and reading countless posts that are similar, I can't for the life of me figure out how to fix it. And it is driving me CRAZY!!!
Any help would be greatly appreciated...
`) to run a command. Change'to`. The commandhelp fordiscusses this.