Page 1 of 1 1
Topic Options
#38788 - 2003-04-04 01:29 PM Delete a directory
miller9 Offline
Fresh Scripter

Registered: 2002-12-30
Posts: 7
i trying to delete the contents of all c:\windows\Temporary Internet Files\

searched around thru the board but dont seem to be able find a soloution that works?

anyone give me some help?

Top
#38789 - 2003-04-04 03:12 PM Re: Delete a directory
AzzerShaw Offline
Seasoned Scripter
****

Registered: 2003-02-20
Posts: 510
Loc: Cheltenham, England
Hi, Do you want this to happen often or just once ? Have you though about using a batch file ? You can pull all the names of your domain into a .txt file and then run the batch to look at the list and delete the changes..
_________________________
If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it. - W.C Fields

Top
#38790 - 2003-04-04 03:14 PM Re: Delete a directory
Ghost Offline
Starting to like KiXtart

Registered: 2000-09-14
Posts: 171
Sorry to mention this, but there is an option in the IE options control panel, for removing the temp files.

Have a look, it's under: Tools > Internet Options > Advanced > Empty Temp Internet Files.

Hope this helps...

[Smile]
_________________________
Who are you? Who slips into my robot body and whispers to my ghost?

Top
#38791 - 2003-04-04 03:24 PM Re: Delete a directory
AzzerShaw Offline
Seasoned Scripter
****

Registered: 2003-02-20
Posts: 510
Loc: Cheltenham, England
This maybe over complicating it a bit but the below could be run if you had a list of pc's that you need the contents deleting on, it may need tweaking a bit but it gives you a general idea..good luck [Embarrassed] )

Break on
Open (1,"drive:\pclist.txt")
Open (2,"drive:\\Success.txt",5)
Open (3,"drive:\fail.txt",5)

WriteLine(2,"---Script Started: @date at @time---"+Chr(13)+Chr(10))

Do
$CompName=ReadLine(1)

If $CompName<>""
Use "$CompName\c$"
If @error = 0
Sleep 1
If Exist("$CompName\c$\windows\Temporary Internet Files\")=1
Del "c:\windows\Temporary Internet Files\"
Else
WriteLine(2,"No temp files found $CompName"+Chr(13)+Chr(10))
WriteLine(3,"$CompName"+Chr(13)+Chr(10))
EndIf
Use "$CompName\C$" /delete
Sleep 2
Else
WriteLine(2," # Failed, $CompName was not available"+Chr(13)+Chr(10))
WriteLine(3,"$CompName"+Chr(13)+Chr(10))
EndIf
Else
EndIf

Until $CompName=""

WriteLine(2,"---Script Finished: @date at @time---"+Chr(13)+Chr(10))
_________________________
If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it. - W.C Fields

Top
#38792 - 2003-04-04 03:32 PM Re: Delete a directory
Ghost Offline
Starting to like KiXtart

Registered: 2000-09-14
Posts: 171
Overly Complicated, you say. Mmmmm, maybe so. Don't forget that inside the Temp Internet Files there are a number of folder which contain all of the temp files.

Using the script above, you wouldn't actually delete anything. The best option is to use the built in function for clearing out the folder.

Or

Set the cache size to 1Mb, then you will save a bucket load of space.

Hope this helps...

[Smile]
_________________________
Who are you? Who slips into my robot body and whispers to my ghost?

Top
#38793 - 2003-04-04 03:34 PM Re: Delete a directory
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Provided the user has Power User rights or better logging in..

code:
CLS
BREAK ON
$REGKEY='HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache'

IF '00000000' <> READVALUE($REGKEY,'Persistent')
$RC=WRITEVALUE($REGKEY,'Persistent','00000000','REG_BINARY')
ENDIF

HTH,

Kent

[ 04. April 2003, 15:47: Message edited by: kdyer ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#38794 - 2003-04-04 03:34 PM Re: Delete a directory
AzzerShaw Offline
Seasoned Scripter
****

Registered: 2003-02-20
Posts: 510
Loc: Cheltenham, England
Overcomplicating the soloution rather than an overcomplicated script [Smile]
_________________________
If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it. - W.C Fields

Top
#38795 - 2003-04-04 03:46 PM Re: Delete a directory
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
The Reg key used in the script was determined using the RegShot Util in the Registry tools list from the FAQ Forum.

It is using the built-in functionality of Internet Explorer where you tell IE to delete the Temporary Internet Files on close of IE.

{Edit}
Just verified at - http://www.winguides.com/registry/display.php/1173/
Made the modification too. [Smile]
{/Edit}

Kent

[ 04. April 2003, 15:49: Message edited by: kdyer ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#38796 - 2003-04-04 04:01 PM Re: Delete a directory
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
This would be my recommendation, too. It is also a cleaner approach than "manually" deleting the contents of the "Temporary Internet Files" folder. I think you can even set this behavior with the IEAK upon rollout or via policies.
_________________________
There are two types of vessels, submarines and targets.

Top
#38797 - 2003-04-04 04:03 PM Re: Delete a directory
miller9 Offline
Fresh Scripter

Registered: 2002-12-30
Posts: 7
thanx for all the replies.. i want the contents of the folder cleared each time a user logs on, work in a school and want the folder cleared everytime a new users logs on is there not some sort of del command that i can use?
Top
#38798 - 2003-04-04 04:15 PM Re: Delete a directory
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Yopu didn't read our replies. You can set Internet Explorer to clear the "Temporary Internet Files" every time Internet Explorer closes. This is the recommended way.

Alternatively do a DELTREE/RD as a SHELL command. However, this is ineffective as it will prolong the login process considerably.

Please reread our replies!
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1077 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.063 seconds in which 0.027 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org