Creating Windows shortcuts from Chrome bookmarks

9

3

I have a very large number of bookmarks in Google Chrome. I want to transfer all of them to a windows folder, so that each bookmark will be a shortcut to a website (I want a list of shortcuts, just like any list of regular applications shortcuts). I also would like to preserve the bookmark's name.

I tried achieving my goal using the Export bookmarks to HTML file in the Organize menu inside the Bookmark Manager, but all I could do with it is save the links manually as html files, and they won't even save with their current bookmarks' names.

amiregelz

Posted 2012-08-20T08:54:20.717

Reputation: 6 965

4Open the HTML file and drag&drop every link to the desktop or a folder? Works in Firefox at least. – Daniel Beck – 2012-08-20T09:27:51.590

1Do you want real Windows shortcuts (.lnk) or just .url files (Internet Explorer's bookmarks format)? – Daniel Beck – 2012-08-20T09:29:30.200

1The Internet Shortcut extension (.url) is what I want. The drag&drop method works, but it would take me a while to do it manually. How can I speed things up? Also, I couldn't find out why I can't add description to the shortcuts after I've dropped them in the folder. – amiregelz – 2012-08-20T10:04:47.207

Given that .url files are simple text files, it should be easy to write a script that converts links in an HTML file to .url files. Do you have Cygwin? – Daniel Beck – 2012-08-20T10:18:08.140

Not at the moment, but I can install it. – amiregelz – 2012-08-20T10:30:27.617

The following works like a charm on OS X based on a Safari bookmarks file, I don't have the batch scripting skills or a Cygwin ready to create a proper Windows solution. #/bin/bash BASEDIR='~/Desktop/bookmarks' ; IFS=$'\n' ; for line in $( grep -oi '<a .*</a>' "$1" ) ; do url=$( echo "$line" | sed 's|.*HREF="\(.*\)".*|\1|g' ) ; name=$( echo "$line" | sed 's|.*>\(.*\)</A>.*|\1|g;s|/||g' ) ; echo '[InternetShortcut]' > "$BASEDIR/$name.url" ; echo "URL=$url" >> "$BASEDIR/$name.url" ; done Reads the HTML file passed as first argument; writes shortcuts to ~/Desktop/bookmarks. – Daniel Beck – 2012-08-20T10:55:17.347

I'm not sure how to use Cygwin to run this script on Windows. – amiregelz – 2012-08-20T15:51:59.327

Take the entire thing, insert a linebreak after #!/bin/bash, change the value assigned to BASEDIR to an empty folder you prepared, and save as htmltourl.sh. Open the Cygwin shell, run chmod +x /path/to/htmltourl.sh, then /path/to/htmltourl.sh /cygdrive/c/path/to/bookmarks.html. If you could provide a Chrome bookmark HTML file, I could can adapt the script if necessary. – Daniel Beck – 2012-08-20T16:19:08.040

Answers

3

After searching the web for a while, I came to the conclusion that there is no simple solution for this problem. There are different methods to save a link or a bookmark as a Windows URL shortcut, but there is no way to do it for multiple links / URLs at once.

Daniel Beck suggested an OS X / Safari bookmarks file based script, but I didn't manage to execute the script because I wasn't sure how to adapt it to Windows, even with Cygwin.

I realized the only way to achieve my goal is by using a script, so I posted a programming-specific question on Stack Overflow and asked for a script which would take the URLs from the links inside the bookmarks.html file and use them to create Windows URL shortcuts.

Here is the question + the answer (it's a VBScript):

Creating multiple Windows URL shortcuts from a bookmarks HTML file.

amiregelz

Posted 2012-08-20T08:54:20.717

Reputation: 6 965

5

Here is what I did:

  1. I exported CHROME BOOKMARKS (also did this to my GOOGLE BOOKMARKS) as a single .html file. This can be done in Chrome through the bookmark manager's ORGANIZE | EXPORT dropdown.

  2. I then opened my USER\Favorites folder. I don't use IE so it had all the default links IE comes with. I created a new folder called CHROME BOOKMARKS.

  3. I opened IE and clicked the star shaped FAVORITES button. I pulled the ADD TO FAVORITES menu down and selected IMPORT AND EXPORT.

This launched an import wizard. I told it I was importing Favorites, and directed it to the .html file Chrome exported (#1), and told it to import to the CHROME BOOKMARKS folder I created (#2).

This created a .url file for each bookmark I had in Chrome which included both the BOOKMARKS BAR and the OTHER BOOKMARKS.

I tested and confirmed that a .URL file is launched in Chrome by double clicking or by drag and drop.

You can import the .URL files into Chrome, too. Leave the CHROME BOOKMARKS folder in your User\Favorites folder and then in Chrome click OTHER BOOKMARKS | IMPORTED FROM IE. I think you can also do this in Chrome's Settings | USERS | Import Bookmarks and Settings, but I did not try this.

Syzyy77

Posted 2012-08-20T08:54:20.717

Reputation: 51

Does it keep Chrome's bookmarks folder structure? – Andrestand – 2014-11-17T10:50:47.510