Solved

Backup Firefox/Chrome Bookmarks - VBScript or Kix

Posted on 2013-06-09
2
2,248 Views
Last Modified: 2013-06-09
Hi,

I need a script in either vbscript or kix to backup Firefox and Chrome bookmarks.
The script should check for a profile folder for either browser and backup the following to the  to U:\ drive.

The folder I need backed-up for Firefox is:
Firefox - %APPDATA%\Mozilla\Firefox\Profiles\[PROFILE NAME]\bookmarkbackups

The files I need backed-up for Chrome are:
Chrome - %LOCALAPPDATA%\Google\Chrome\User Data\Default\Bookmarks and Bookmarks.bak

If a profile does not exist then it should be skipped. A log file should be created.

I appreciate your help on this.

IV
0
Comment
Question by:ivanoviola
  • 2
2 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 39233025
0
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
ID: 39233038
here complete script:
Set FSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")

destination = "U:\"
appdata = objShell.ExpandEnvironmentStrings("%APPDATA%")
localAppData = objShell.ExpandEnvironmentStrings("%LOCALAPPDATA%")

ff_bookmarks = appdata & "\Mozilla\Firefox\Profiles\"
chrome_bookmarks = localAppData & "\Google\Chrome\User Data\Default\Bookmarks"
chrome_bookmarks_bak = localAppData & "\Google\Chrome\User Data\Default\Bookmarks.bak"

''firefox
For Each Subfolder in FSO.GetFolder(ff_bookmarks).SubFolders
	ff_profile_bookmarks = Subfolder.Path & "\bookmarkbackups"
	if (fso.FolderExists(ff_profile_bookmarks)) then
		fso.CopyFolder ff_profile_bookmarks, destination
		wscript.echo "copy " & ff_profile_bookmarks & " to " & destination
	end if
Next

''chrome
If (fso.FileExists(chrome_bookmarks_bak)) Then
	fso.CopyFile chrome_bookmarks_bak , destination & "Bookmarks.bak"
	wscript.echo "copy " & chrome_bookmarks & " to " & destination
end if	

If (fso.FileExists(chrome_bookmarks)) Then
	fso.CopyFile chrome_bookmarks , destination & "Bookmarks"
	wscript.echo "copy " & chrome_bookmarks & " to " & destination
end if

wscript.echo "Done."

Open in new window


if u change the destination, make sure to have slash at the end (i.e. "U:\some-folder\")
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now