Jump to content

Recommended Posts

Posted (edited)

hi,

i have nearly finished my firefox script but got 1 last problem

Here is the script - see if anyone knows how 2 help

;Clear Profile

DirRemove(@HomeDrive & "\Users\" & @UserName & "\AppData\Local\Mozilla\Firefox\Profiles\", 1)

DirCreate(@HomeDrive & "\Users\" & @UserName & "\AppData\Local\Mozilla\Firefox\Profiles\")

; Form History & Downloads & cookies & search

FileDelete(@HomeDrive & "\Users\" & @UserName & "\AppData\Roaming\Mozilla\Firefox\Profiles\???????\formhistory.sqlite")

FileDelete(@HomeDrive & "\Users\" & @UserName & "\AppData\Roaming\Mozilla\Firefox\Profiles\???????\cookies.sqlite")

FileDelete(@HomeDrive & "\Users\" & @UserName & "\AppData\Roaming\Mozilla\Firefox\Profiles\???????\search.sqlite")

(I know you can just go ryt to the temp directory but it wouldnt work for some reason)

the problem is the directory is different for all computers where i put the question marks, how can i get it to go to the directory what ever it says, looked in to the search function but im struggling

any ideas please

tnx

Edited by am632
Posted (edited)

hi,

i have nearly finished my firefox script but got 1 last problem

Here is the script - see if anyone knows how 2 help

;Clear Profile

DirRemove(@HomeDrive & "\Users\" & @UserName & "\AppData\Local\Mozilla\Firefox\Profiles\", 1)

DirCreate(@HomeDrive & "\Users\" & @UserName & "\AppData\Local\Mozilla\Firefox\Profiles\")

; Form History & Downloads & cookies & search

FileDelete(@HomeDrive & "\Users\" & @UserName & "\AppData\Roaming\Mozilla\Firefox\Profiles\???????\formhistory.sqlite")

FileDelete(@HomeDrive & "\Users\" & @UserName & "\AppData\Roaming\Mozilla\Firefox\Profiles\???????\cookies.sqlite")

FileDelete(@HomeDrive & "\Users\" & @UserName & "\AppData\Roaming\Mozilla\Firefox\Profiles\???????\search.sqlite")

(I know you can just go ryt to the temp directory but it wouldnt work for some reason)

the problem is the directory is different for all computers where i put the question marks, how can i get it to go to the directory what ever it says, looked in to the search function but im struggling

any ideas please

tnx

Use the _FileListToArray function:

#Include <File.au3>

$Path = @HomeDrive & "\Users\" & @UserName & "\AppData\Roaming\Mozilla\Firefox\Profiles\"
$Folders = _FileListToArray($Path,"*",2)
$Loop = UBound($Folders)

For $i = 1 to $Loop
FileDelete(@HomeDrive & "\Users\" & @UserName & "\AppData\Roaming\Mozilla\Firefox\Profiles\" & $Folders[$i] & "\formhistory.sqlite")

FileDelete(@HomeDrive & "\Users\" & @UserName & "\AppData\Roaming\Mozilla\Firefox\Profiles\" & $Folders[$i] & "\cookies.sqlite")

FileDelete(@HomeDrive & "\Users\" & @UserName & "\AppData\Roaming\Mozilla\Firefox\Profiles\" & $Folders[$i] & "\search.sqlite")
next
Edited by Emolas
Posted

Hi, thanks for the help, the script works nicely and does the job but i get an error when i run it (although it still works), how can i stop the error popping up please?

I have attached a screenshot of the error

thanks

post-49753-12534598748707_thumb.jpg

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
  • Recently Browsing   0 members

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