Jump to content

Can't delete HIstory or Temporary Internet files


MrBedo
 Share

Recommended Posts

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

Link to comment
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?
Link to comment
Share on other sites

You could always use XPClean by Valuater


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

Link to comment
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

Link to comment
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

Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...