Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > Re: suggestions for clearing user junk files from profiles (temp and temp.internet files)

Reply
Thread Tools Display Modes

Re: suggestions for clearing user junk files from profiles (temp and temp.internet files)

 
 
Pegasus [MVP]
Guest
Posts: n/a

 
      02-02-2010


<> said this in news item
news:38cbf113-6072-4cb1-9d68-...
> 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


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%\*.*"


 
Reply With Quote
 
 
 
 
Pegasus [MVP]
Guest
Posts: n/a

 
      02-05-2010


<> said this in news item
news:8b992674-84c0-4891-a47c-...
> On Feb 2, 1:49 pm, "Pegasus [MVP]" <n...@microsoft.com> wrote:
>> <pheoni...@gmail.com> said this in news
>> itemnews:38cbf113-6072-4cb1-9d68-...
>>
>>
>>
>> > 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

>>
>> 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%\*.*"

>
>
> 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.

 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59