am632 Posted September 13, 2009 Posted September 13, 2009 (edited) Hi, i need help with a script to delete firefox files - (Browsing & download history, form & search history, cookies, cache, active logins & site preferences) theres a couple of things i need help with - i guess i just use 'FileDelete()' with the directory of the firefox temp files, but if my user account name is 'user' how would you make it clean all users or just the current user? also the cache files are located at C:\Users\user\AppData\Local\Mozilla\Firefox\Profiles\dpbfn4a8.default\Cache but are @ C:\Users\user\AppData\Local\Mozilla\Firefox\Profiles\ypgng3a7.default\Cache on my other computer. and because these directories are slightly different, i cant hardcode the directory in the script. can any one help me out please. im using vista on this laptop btw, and xp on the other machine. thanks Edited September 13, 2009 by am632
Hawkwing Posted September 13, 2009 Posted September 13, 2009 Why not just go to options/privacy and check Always clear my private data when I close Firefox and set the settings? The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.
am632 Posted September 13, 2009 Author Posted September 13, 2009 tnx, i do already know how to do that, does anyone know the answer 2 my question please?
Stilgar Posted September 13, 2009 Posted September 13, 2009 You can find the profiles-dir in the profiles.ini @AppDataDir & "\Mozilla\Firefox\profiles.ini" jEdit4AutoIt PlanMaker_UDF
am632 Posted September 14, 2009 Author Posted September 14, 2009 Thanks for the tip. The point im trying to get at tho is how would you remove files from a changing directory. for example... lets say there is a folder called temp of 50 computers, and each computer has a different username. the directory would be different for each user as their name would be different such as C:\Users\username1\Desktop\TEMP & C:\Users\username2\Desktop\TEMP so rather than hardcode the directories for each user cant you substitute the username with something else? i remember seeing something once somewhere else like %user% eg C:\Users\%user%\Desktop\TEMP Do you get what i mean? tnx
jvanegmond Posted September 14, 2009 Posted September 14, 2009 On 9/14/2009 at 5:59 PM, 'am632 said: Thanks for the tip.The point im trying to get at tho is how would you remove files from a changing directory.for example... lets say there is a folder called temp of 50 computers, and each computer has a different username. the directory would be different for each user as their name would be different such asC:\Users\username1\Desktop\TEMP & C:\Users\username2\Desktop\TEMPso rather than hardcode the directories for each user cant you substitute the username with something else? i remember seeing something once somewhere else like %user%eg C:\Users\%user%\Desktop\TEMPDo you get what i mean?tnxAutoIt macro: @TempDirLook it up. github.com/jvanegmond
am632 Posted September 15, 2009 Author Posted September 15, 2009 tnx for the tip Manadar - the simple line of code i was looking for is... DirRemove(@HomeDrive & "\Users\" & @UserName & "\AppData\Local\Mozilla\Firefox\Profiles\", 1) DirCreate(@HomeDrive & "\Users\" & @UserName & "\AppData\Local\Mozilla\Firefox\Profiles\") (easy when u kno what your looking for) one more question plz... i would like to run the code FileDelete(@HomeDrive & "\Users\" & @UserName & "\AppData\Roaming\Mozilla\Firefox\Profiles\bc168gcb.default\cookies.sqlite") however on my other computers the "bc168gcb.default" is different each time - firefox says its for extra security reasons. how would i go about a substitute for this... like a kinda wildcard but not if u get what i mean so i can run the script on all computers?
jvanegmond Posted September 15, 2009 Posted September 15, 2009 This: @HomeDrive & "\Users\" & @UserName & "\AppData\ is also in a macro called @AppDataDir It's better to use @AppDataDir, because for example: Windows XP don't have a Users folder but they have "Documents and Settings" instead. Also, not everyone has their \Users\ folder on the homedrive. Wildcards work with FileDelete (not sure if you can use this): FileDelete(@HomeDrive & "\Users\" & @UserName & "\AppData\Roaming\Mozilla\Firefox\Profiles\*.default\cookies.sqlite") github.com/jvanegmond
am632 Posted September 15, 2009 Author Posted September 15, 2009 On 9/15/2009 at 6:23 PM, 'Manadar said: This: @HomeDrive & "\Users\" & @UserName & "\AppData\ is also in a macro called @AppDataDir It's better to use @AppDataDir, because for example: Windows XP don't have a Users folder but they have "Documents and Settings" instead. Also, not everyone has their \Users\ folder on the homedrive. Wildcards work with FileDelete (not sure if you can use this): FileDelete(@HomeDrive & "\Users\" & @UserName & "\AppData\Roaming\Mozilla\Firefox\Profiles\*.default\cookies.sqlite") Oh ryt, so I can use the same script on xp and vista to save me doing a seperate one, kwl, tnx for that. I already tried the *.default too but no luck there... Jus an idea, could i possibly create a new macro for this, 'cos for example - correct me if im wrong but if @AppDataDir can detect the directory for thhe temp folder, could a macro detect the randomly generated foldername? tnx
jvanegmond Posted September 15, 2009 Posted September 15, 2009 I don't understand why the wildcard doesn't work here. But there are two functions that can search files and directories, you can use those to find the .default directory. These functions are: FileFindFirstFile FileFindNextFile github.com/jvanegmond
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