?
Solved

Backup Firefox/Chrome Bookmarks - VBScript or Kix

Posted on 2013-06-09
2
Medium Priority
?
2,737 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:Ivano Viola
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 39233025
0
 
LVL 42

Accepted Solution

by:
sedgwick earned 2000 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

Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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)
Suggested Courses

762 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