MrBedo Posted December 14, 2005 Posted December 14, 2005 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
seandisanti Posted December 14, 2005 Posted December 14, 2005 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 helphave you tried using a filefindfirstfile .... filefindnextfile to accomplish the same thing deleting the files one by one?
BigDod Posted December 14, 2005 Posted December 14, 2005 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
MrBedo Posted December 14, 2005 Author Posted December 14, 2005 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
Valuater Posted December 14, 2005 Posted December 14, 2005 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)
MHz Posted December 14, 2005 Posted December 14, 2005 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.
MrBedo Posted December 15, 2005 Author Posted December 15, 2005 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now