Solved

Backup Firefox/Chrome Bookmarks - VBScript or Kix

Posted on 2013-06-09
2
2,645 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 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

Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

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

This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

729 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