Alan's Blog

"Yeah. I wrote a script that will do that."

Menu
  • About My Blog
Menu

Open a Hyperlink URL from Clipboard

Posted on September 16, 2013 by Alan

I write scripts when I see a way to automate a task that I find myself doing repetitively.  Because I force email to text, I frequently get emails with URLs that have a line break.  Occasionally they will have a space, tab or even a greater than sign “>” if forwarded from another source.  I found myself highlighting the address then pasting it into notepad, removing the junk, recopying and then launching the browser.  Truly annoying.

Back in 2004, Scripting Guy Ed Wilson write a script to launch a URL from the clipboard, but it did not clean up the text.  I also thought it would be nice to avoid the Internet Explorer clipboard warning when possible.  One of the things I wanted to be able to determine was the default browser.  Before Windows 8, you could find this in “HKCR\http\shell\open\ddeexec\Application\”. Finding the entry in Windows 8 had me stumped.  Ed and Jason (a PFE at Microsoft) located it here: “HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice\ProgId”

The resulting script, OpenClipboardURL.vbs,  is way too big for the simple task.  But it will take advantage of Word’s clipboard if installed, and understands alternate browsers.  I use it every day, putting it into Alan’s Favorites.

Leave a Reply

You must be logged in to post a comment.

Search

Please Note

All the scripts are saved as .txt files. Newer files have a “View Script” button which will let you save or open a script in notepad. For earlier posts, the easiest way to download with IE is to right click on the link and use “Save Target As”. Rename file from Name_ext.txt to Name.ext.

To see a full post after searching, please click on the title.

PowerShell Scripts were written with version 3 or later.

https connections are supported.

All new users accounts must be approved, as are comments. Please be patient.  If you find a post error or a script which doesn’t work as expected, I appreciate being notified.  My email is my first name at the domain name, and you are welcome to contact me that way.

Tags

1E ACLS Active Directory ActiveDirectory ADSI Advanced Functions Audit Change Administrator Password COMObject Computer Groups DateTime Desktop DNS Excel FileScriptingObject Forms General GPO GPS Group Policy Hacks ISE Lockout logons NAV740 Nessus OU OU permissions Outlook Pick Folder Power PowerShell Powershell Scriptlets RDP SCCM schedule reboot Scripting Security Shell.Application user information VBA Windows Update WMI WordPress WPF

Categories

akaplan.com

  • Back to Home Page

Archives

Scripting Sites

  • A Big Pile of Small Things
  • Adam, the Automator
  • Art of the DBA
  • Ashley McGlone
  • Boe Prox
  • Carlo Mancini
  • DexterPOSH
  • Doug Finke
  • Jaap Brasser's Blog
  • JeffOps The Scripting Dutchman
  • Jonathan Medd's Blog
  • Keith Hill's Blog
  • LazyWinAdmin
  • Nana Lakshmanan
  • PowerShell Magazine
  • PowerShell Team Blog
  • PowerShell.org
  • PwrShell.net
  • Richard Siddaway's Blog
  • Ryan Yates' Blog
  • Skatterbrainz
  • The Lonely Administrator

SQL Site

  • Art of the DBA

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
©2025 Alan's Blog | Theme by SuperbThemes

Terms and Conditions - Privacy Policy