for /d %a in (%docandset%\*) do call :cleanup "%a"
I figured out how to get rid of the error. I changed the above line to:
for /d %%a in (%docandset%\*) do call :cleanup "%%a"
So now I just can't get it to have the correct quotes. Please note the " before \Local
This is the output I am getting:
rd /s /q "C:\documents and settings\Administrator"\Local Settings\Temporary Internet Files\Content.IE5"
rd /s /q "C:\documents and settings\All Users"\Local Settings\Temporary Internet Files\Content.IE5"
rd /s /q "C:\documents and settings\GaryT"\Local Settings\Temporary Internet Files\Content.IE5"
rd /s /q "C:\documents and settings\scans"\Local Settings\Temporary Internet Files\Content.IE5"
Here is what I have now:
@echo off
:: Remove everything in temp files for ALL users
setlocal
set docandset="%homedrive%\documents and settings"
for /d %%a in (%docandset%\*) do call :cleanup "%%a"
goto :eof
:cleanup
echo rd /s /q %1\Local Settings\Temporary Internet Files\Content.IE5" 2>nul
:eof