Skip to content
2008/05/06 / Koen Vermoesen

ConvertUNC2URL.bat

The old Lotus Notes client at my current assignment doesn’t seem to like UNC-paths. If I want to make sure links are clickable I need to convert the path to a URL.

I originally used a excel workbook for it, but that’s obviously overkill. Enter the script below:

@echo off
cls
set url=%*
set url=%url:\\=file://%
set url=%url:\=/%
echo %url% | clip
echo URL has been converted and copied to your clipboard!
set url=

I simply launch it from the command prompt and pass the UNC path to it. The script returns the corresponding URL to my clipboard for easy pasting!

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

Please log in to WordPress.com to post a comment to your blog.

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 86 other followers