Discussion:
suggestions for clearing user junk files from profiles (temp and temp.internet files)
(too old to reply)
p***@gmail.com
2010-02-02 17:40:11 UTC
Permalink
hello,
I've been searching for a way to delete user junk files like it states
in subject box.
Setting IE settings to clear temp files when the browser is closed
does NOT work.
Making disk space 0 for temp files also leaves plenty of junk files
behind.

The only way I have seen to clear the files is manually.

I've found this script to erase the junk files. It works by putting
it in the all users folder in startup.

c:
cd\
cd C:\Documents and Settings\%username%\Local Settings\Temporary
Internet Files
del *.* /f/s/q
cd \
cd c:\Documents and Settings\%username%\Local Settings\Temp
del *.* /f/s/q
exit

What is a good way to make this work via login (or logout) scripts via
active directory?

Thank you,

Oskar
Pegasus [MVP]
2010-02-02 19:49:13 UTC
Permalink
Post by p***@gmail.com
hello,
I've been searching for a way to delete user junk files like it states
in subject box.
Setting IE settings to clear temp files when the browser is closed
does NOT work.
Making disk space 0 for temp files also leaves plenty of junk files
behind.
The only way I have seen to clear the files is manually.
I've found this script to erase the junk files. It works by putting
it in the all users folder in startup.
cd\
cd C:\Documents and Settings\%username%\Local Settings\Temporary
Internet Files
del *.* /f/s/q
cd \
cd c:\Documents and Settings\%username%\Local Settings\Temp
del *.* /f/s/q
exit
What is a good way to make this work via login (or logout) scripts via
active directory?
Thank you,
Oskar
The above script is higly dangerous. If the second command (the "cd"
command) fails for some reason (and there are several reasons why it might
fail!) then you are likely to cause permanent damage to your machine or
delete all your data files. Use this version instead:
@echo off
del /s /q /f "%UserProfile%\Local Settings\Temporary Internet
Files\Content.ie5\*.*"
del /s /q /f "%temp%\*.*"
p***@gmail.com
2010-02-04 17:27:55 UTC
Permalink
Post by Pegasus [MVP]
Post by p***@gmail.com
hello,
I've been searching for a way to delete user junk files like it states
in subject box.
Setting IE settings to clear temp files when the browser is closed
does NOT work.
Making disk space 0 for temp files also leaves plenty of junk files
behind.
The only way I have seen to clear the files is manually.
I've found this script to erase the junk files.  It works by putting
it in the all users folder in startup.
cd\
cd C:\Documents and Settings\%username%\Local Settings\Temporary
Internet Files
del *.* /f/s/q
cd \
cd c:\Documents and Settings\%username%\Local Settings\Temp
del *.* /f/s/q
exit
What is a good way to make this work via login (or logout) scripts via
active directory?
Thank you,
Oskar
The above script is higly dangerous. If the second command (the "cd"
command) fails for some reason (and there are several reasons why it might
fail!) then you are likely to cause permanent damage to your machine or
@echo off
del /s /q /f "%UserProfile%\Local Settings\Temporary Internet
Files\Content.ie5\*.*"
del /s /q /f "%temp%\*.*"
That's awesome! I'll try this.
Thank you :)

Oskar
Pegasus [MVP]
2010-02-05 11:46:15 UTC
Permalink
Post by p***@gmail.com
Post by Pegasus [MVP]
Post by p***@gmail.com
hello,
I've been searching for a way to delete user junk files like it states
in subject box.
Setting IE settings to clear temp files when the browser is closed
does NOT work.
Making disk space 0 for temp files also leaves plenty of junk files
behind.
The only way I have seen to clear the files is manually.
I've found this script to erase the junk files. It works by putting
it in the all users folder in startup.
cd\
cd C:\Documents and Settings\%username%\Local Settings\Temporary
Internet Files
del *.* /f/s/q
cd \
cd c:\Documents and Settings\%username%\Local Settings\Temp
del *.* /f/s/q
exit
What is a good way to make this work via login (or logout) scripts via
active directory?
Thank you,
Oskar
The above script is higly dangerous. If the second command (the "cd"
command) fails for some reason (and there are several reasons why it might
fail!) then you are likely to cause permanent damage to your machine or
@echo off
del /s /q /f "%UserProfile%\Local Settings\Temporary Internet
Files\Content.ie5\*.*"
del /s /q /f "%temp%\*.*"
That's awesome! I'll try this.
Thank you :)
Oskar
Thanks for the feedback. I would not call this "awesome" - it's just using
standard batch file techniques with an eye to making them robust. "Robust"
means: Never assume anything in batch files.

Loading...