Sign in to follow this  
Followers 0
MrBedo

Can't delete HIstory or Temporary Internet files

7 posts in this topic

I'm trying to create a script that will delete the content of the following folders:

c:\Documents and Settings\<USERNAME>\Local Settings\History\

c:\Documents and Settings\<USERNAME>\Local Settings\Temp\

c:\Documents and Settings\<USERNAME>\Local Settings\Temporary Internet Files\

but no matter what I try (even calling a del command from within DOS) I can't get those files to delete. If I add a folder called 'TEST' under the 'Local Settings' folder and throw some random files in it then the script will delete those without issue.

I've searched through the forums, but really couldn't find an answer to this, other than a script that actually opens the internet options applet and 'pushes' the delete files button etc, which isn't what I want.

Can anyone tell me why I can't delete these files in this way, or suggest an alternative method ?

Heres my (simple!) script:

FileDelete("C:\Documents and Settings\" & @Username & "\Local Settings\Temp\*.*")

FileDelete("c:\Documents and Settings\" & @Username & "\Local Settings\History\*.*")

FileDelete("c:\Documents and Settings\" & @Username & "\Local Settings\Temporary Internet Files\*.*")

thanks in advance for any help

Share this post


Link to post
Share on other sites



I'm trying to create a script that will delete the content of the following folders:

c:\Documents and Settings\<USERNAME>\Local Settings\History\

c:\Documents and Settings\<USERNAME>\Local Settings\Temp\

c:\Documents and Settings\<USERNAME>\Local Settings\Temporary Internet Files\

but no matter what I try (even calling a del command from within DOS) I can't get those files to delete. If I add a folder called 'TEST' under the 'Local Settings' folder and throw some random files in it then the script will delete those without issue.

I've searched through the forums, but really couldn't find an answer to this, other than a script that actually opens the internet options applet and 'pushes' the delete files button etc, which isn't what I want.

Can anyone tell me why I can't delete these files in this way, or suggest an alternative method ?

Heres my (simple!) script:

FileDelete("C:\Documents and Settings\" & @Username & "\Local Settings\Temp\*.*")

FileDelete("c:\Documents and Settings\" & @Username & "\Local Settings\History\*.*")

FileDelete("c:\Documents and Settings\" & @Username & "\Local Settings\Temporary Internet Files\*.*")

thanks in advance for any help

have you tried using a filefindfirstfile .... filefindnextfile to accomplish the same thing deleting the files one by one?

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

You could always use XPClean by Valuater



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Cameronsdad - no I havent, never used those commands before so I ll look into it.

Bigdod - thanks, I have seen that program but I need to be able to delete these folders with my own script.

Does anyone know why it isnt a straight forward job to just delete these files from those folders ?

cheers

Share this post


Link to post
Share on other sites

maybe this

Run('control inetcpl.cpl')

WinWait('Internet Properties')
ControlClick('Internet Properties', '', 'Button6')

WinWait('Delete Cookies')
ControlClick('Delete Cookies', '', 'Button1')

If Not WinWaitActive('Internet Properties') Then WinActivate('Internet Properties')
ControlClick('Internet Properties', '', 'Button7')

WinWait('Delete Files')
ControlClick('Delete Files', '', 'Button2')

If Not WinWaitActive('Internet Properties') Then WinActivate('Internet Properties')
ControlClick('Internet Properties', '', 'Button10')

WinWait('Internet Options')
ControlClick('Internet Options', '', 'Button1')

WinWait('Internet Properties')
ControlClick('Internet Properties', '', 'Button15')

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Probably because some of them are not real folders.

At a command console window, cd to local settings and use the dir command.

I only see the temp folder and can use /a:h switch to see the Application Data folder. History and Temporary Internet Files would be shell folders as they are not shown with the dir command.

Share this post


Link to post
Share on other sites

Thanks MHz, that makes sense as to why it's acting strangely.

Thanks to everyone for their comments, I got it working in the end by using the @COMSPEC macro and playing witht he folder switches.

cheers

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0