Convert path to URL?


  1. Posts : 8
    Windows 7 Professional 32 bit
       #1

    Convert path to URL?


    I am looking for quickie app into which I can paste a Windows 7 file path and which converts it to a URL.
    Very simple: prefixes the path with file:/// and then changes all the \'s to /'s.
    (Easy to edit the paths but life's too short).
    Are there any suggestions?
      My Computer


  2. Posts : 10,485
    W7 Pro SP1 64bit
       #2

    It sounds like you currently put a path to a file into the OS clipboard (perhaps using shift-right-click from within Windows Explorer) and then paste/modify that info into the address field of a browser - correct?

    Does the path that you start with contain a mapped drive letter or is it a UNC connection? Do you need the app that you are looking for to handle both local/mapped drive paths and UNC paths?

    Are there quotation marks around the original path?

    Most browsers already convert \ to / and they will handle a mapped local, mapped and UNC paths as is.
      My Computer


  3. Posts : 8
    Windows 7 Professional 32 bit
    Thread Starter
       #3

    UsernameIssues said:
    It sounds like you currently put a path to a file into the OS clipboard (perhaps using shift-right-click from within Windows Explorer) and then paste/modify that info into the address field of a browser - correct?

    Does the path that you start with contain a mapped drive letter or is it a UNC connection? Do you need the app that you are looking for to handle both local/mapped drive paths and UNC paths?

    Are there quotation marks around the original path?

    Most browsers already convert \ to / and they will handle a mapped local, mapped and UNC paths as is.
    I use Thunderbird email client and can Save an email as .eml.
    Then in PowerDesk file manager I select the file and Edit, Copy Path as Text.
    I then paste this text path into the Notes pane of 'Handy Address Book' against the relevant contact.
    HAB doesn't know about Windows paths but if in HAB I prefix the path with 'file:///' and change the back-slashes to make it a URL it goes blue and I can click on it to open the .eml file in my default Opera browser.
    From there I can paste the relevant text back into HAB under the relevant URL.
    This is very readable and useful.

    However I was brought up with Unix and my file paths are often very long; no Libraries, no My Documents, etc. and so editing the paths is tedious.
    There must a way to automate this. I do like HAB for managing contacts; maybe something completely different is called for...
      My Computer


  4. Posts : 10,485
    W7 Pro SP1 64bit
       #4

    A few lines of scripting via AutoIt should do what you want:

    Code:
    $var = StringReplace(ClipGet(), "\", "/")
    $var = StringReplace($var, "c:", "file://")
    ClipPut($var)
    You can edit the "c:" part as needed.

    You can run that script via an OS shortcut key...
    (assign it something like Ctrl-Alt-c for convert)
    ...or you can add code that lets it run all of the time - converting the info in the OS clipboard when you press some key or key combo.

    Personally, I would leave the script as a text file and run it like that. If you would rather compile it, see the info just above and below the last video in this post.
      My Computer


  5. Posts : 8
    Windows 7 Professional 32 bit
    Thread Starter
       #5

    Apologies for late acknowledgement.
    I am working through AutoIt and it does look as if it will do the job.
      My Computer


  6. Posts : 1
    Windows 7 Ultimate 64 bit
       #6

    Hello,

    this task can be solved a lot easier with "Copy UNC Path". That's indeed a great tool.

    Kind regards,

    DAC324
      My Computer


  7. Posts : 10,485
    W7 Pro SP1 64bit
       #7

    DAC324 said:
    Hello,

    this task can be solved a lot easier with "Copy UNC Path". That's indeed a great tool.

    Kind regards,

    DAC324
    How does that tool create a URL?
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 12:22.
Find Us