DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Unc to Web link converter  (Read 10,765 times)

justice

  • Solve issues simply.
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • Participated in NANY Challenge Four Times
    • Cody Award
    • Coding Snacks
    • DJ Badge - DJ
Unc to Web link converter
« on: February 04, 2009, 02:43 PM »
Had an issue here where the mindtouch wiki that's used on an internal project mangles up UNC path style links. So I created an autohotkey script that converts it into a file:// protocol link and copies it to the clipboard. Thought maybe it would be useful for someone on here (or their colleagues).

You can do the same by pasting the link into Firefox and copying the result - but try to tell that to someone that tries to map a network drive using the tools menu in outlook (how to install firefox, get the link copied out the email, into the address bar, coping it out again and into their wik).

Code
; Unc2Web.ahk
#NoEnv
InputBox, OutputVar, UNC TO WEB LINK, Please put in a link to the UNC Network Path:`n`n For example: `n\\f_server2\share\New Folder\index.html`n\\f_server2\share\New Folder
if NOT ErrorLevel
{
	OutputVar := RegExReplace(OutputVar, "\\\\", "file://") 
	OutputVar := RegExReplace(OutputVar, "\\", "/")  
	clipboard := OutputVar
	InputBox, bla, UNC TO WEB LINK, The following link has been copied to your clipboard. Use it in wikis or other webpages - this link only works internally.,,,,,,,,%Outputvar%		
}

2009-02-04_135338.jpg
2009-02-04_135353.jpg
2009-02-04_135413.jpg
« Last Edit: February 04, 2009, 02:53 PM by justice »

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • Coding Snacks
    • Volunteers/Staff
    • Gathering Badge
    • Participated in NANY Challenge Once
    • Linux User
Re: Unc to Web link converter
« Reply #1 on: February 05, 2009, 01:25 AM »
nice, downloading it.. :Thmbsup:

justice

  • Solve issues simply.
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • Participated in NANY Challenge Four Times
    • Cody Award
    • Coding Snacks
    • DJ Badge - DJ
Re: Unc to Web link converter
« Reply #2 on: June 26, 2012, 12:17 PM »
If you want to play with the latest source, you can now fork from Bitbucket:
https://bitbucket.org/svandragt/unc2web

I'll keep posting executable releases in this topic when they're available.

Original address: https://www.donationcoder.com/forum/index.php?topic=16898.0