If you run attrib on that folder with the /S switch, it should unhide all child objects.
attrib -R %PathToTempFiles%\folder /S
Just put that near the top of the batch file.
Main Topics
Browse All TopicsHi experts,
I have been using a batch file that I obtained here from this thread, included below.
It works great to delete the contents of content.ie5, temp, temporary internet files and cookies under all the profiles in c:\documents and settings, EXCEPT when the folders are hidden.
Can this batch file be modified to delete the hidden folders and their contents?
Please don't give me vb scripts unless it is the only solution because I don't know how to run them, that is unless you provide an explanation fit for a vb rank newbie.
Even more frustrating is XP won't allow me to change the hidden attribute on these folders even when I am logged on as admin. Is there a way around this annoying"feature?"
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
thanks much to both of you, but I can't get it to change the attribute. Here's what I put in the file:
FOR /D %%X IN ("%SRC1%\*") DO FOR %%Y IN ("%%X\%SRC2%\*.*") DO attrib -s -r -h /S %%Y /S /Q "%%Y"
The batch file returns:
FOR %Y IN ("C:\Documents and Settings\useprofilename\Lo
It hits each profile on the machine but doesn't change the attributes.
jared_luker:
The problem is we have multiple user profiles on each machine, some of which may differ from others and we need the variables to pick up the differing profiles under documents and settings.
Sorry I did not mention this is xp service pack 2
thanks again for any help,
maureen
Here's what happened when I made the changes.
for FOR /D %%X IN ("%SRC1%\*") DO FOR %%Y IN ("%%X\%SRC2%\*.*") DO attrib -s -r -h /S /D "%%Y"
it sends the command:
C:\WINDOWS>FOR %Y IN ("C:\Documents and Settings\Administrator\Loc
Then it comes back for the index file only:
C:\WINDOWS>attrib -s -r -h /S /D "C:\Documents and Settings\Administrator\Loc
for FOR /D %%X IN ("%SRC1%\*") DO FOR %%Y IN ("%%X\%SRC4%\*.*") DO attrib -s -r -h /S /D "%%Y"
it sends the command:
C:\WINDOWS>FOR / %X IN ("C:\Documents and Settings\*") DO FOR %Y IN ("%X\Local Settings\Temp\*.*") DO attrib -s -r -h /S
and returns this:
C:\WINDOWS>FOR %Y IN ("C:\Documents and Settings\Administrator\Loc
and doesn't show any files changed.
Below is the entire file complete with pauses in case I mistyped something. Also, I only used the administrator account because I didn't want to use usernames, it does the same for each profile and won't change the hidden stuff.
So does all this mean that as administrator the hidden attributes can't be changed?
Thanks again for all the help!
Maureen
Qlemo:
I tried your code, and it seems to have worked, deleting the hidden directories under \documents and settings\profilename\local
However, it didn't delete the hidden files from the \documents and settings\profilename\cooki
Does something need to be added for this?
Thanks so much for your help!
Maureen
Business Accounts
Answer for Membership
by: QlemoPosted on 2009-05-19 at 09:57:28ID: 24424070
Just replace any del or rmdir command with (the round brackets are part of the line):
(attrib -s -r -h /S %%Y & RMDIR /S /Q "%%Y")
resp.
(attrib -s -r -h /S %%Y & DEL /F /S /Q "%%Y")