Along those same lines... what is the easiest way to deal with looping through a directory set that includes spaces (ie "Documents and Settings")?
I have a situation where I need to find specific files (wildcard search) on a drive to do a secure delete on these specific files. I know I can do this with a "Dir /s/b", but if the files are included with a directory that has spaces, there are identification situations that are hosed due to the spaces.
Currently, I am looking at:
Code:
Set LookUpSet=Dir /b/s File1* File2*
For /F %%F In ('%LookUpSet%') DO (
Echo;
Echo Path: %%~fF
Echo File: %%~nxF
Echo;
Pause
)
When I get to a File1* entry that happens to be in "Documents and Settings" the reply is:
Code:
Path: C:\Documents
File: Documents
Thanks for your help!
-Rick