Modify batch files to delete hidden MSO temp content

tegenius
tegenius used Ask the Experts™
on
I have a batch file written for our terminal services environment (citrix) to tidy up users profiles of temporary files etc. It seems to be missing the "Content.MSO" folder even though I have specifically stated the path. The only difference is that this folder is hidden. I thought the /ah switch would fix this?

How would I go about changing the code to delete these MSO.Content files?
for /d %%d in ("d:\ts\profiles\*") do del /ah /s /q "%%d\local settings\temporary internet files\*" >> Cleanup.txt
for /d %%d in ("d:\ts\profiles\*") do del /ah /s /q "%%d\local settings\temporary internet files\Content.MSO\*" >> Cleanup.txt
for /d %%d in ("d:\ts\profiles\*") do del /ah /s /q "%%d\local settings\history\*" 2>> Cleanup.txt
for /d %%d in ("d:\ts\profiles\*") do del /ah /s /q "%%d\cookies\*" 2>> Cleanup.txt

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Using the /ah switch you select (!) based on the hidden attribute.
This will only delete hidden files. But in your case only the directory seems to be hidden.

If you simply remove the /ah switch it should work.

Author

Commented:
Yes! It worked! If only I had thought of that in the first place :-D

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial