5

I have some .url file. I know they are simpy plain text files (cfr. http://www.fmtz.com/formats/url-file-format/article)

But I cant find a way to edit it.

In example, using Notepad++ on Windows 8: clicking Open file, going in the folder where a .url file resides and selecting it happens an odd thing: start a "download" from (I guess) a local temp folder and then I get this error:

enter image description here

Confusing...

Any idea?

1
  • 1
    Did you try dragging the .url file, and dropping it in an empty Notepad++ document window?
    – and31415
    Feb 20, 2014 at 14:15

6 Answers 6

1

Put Notepad into your SendTo folder, then right-click and select Notepad from your Send To menu.  I assume that this would work for Notepad++ too.

0
2

As a one time thing, here is an easy way:

  1. Open a Windows "Command Prompt"
  2. Navigate to the folder containing the ".URL" file that you want to edit.
    For this example, let's say your ".URL" file is named "Example.url"
  3. Rename the file to add a ".txt" extension.
    C:\>ren "Example.url" "Example.url.txt"
  4. Leave the "Command Prompt" window open for later.
  5. Edit the file in the usual way you would edit a ".txt" file, using your favorite text editor.
  6. Return to the open "Command Prompt" window.
  7. Rename the file back as it was, by removing the ".txt" extension.
    C:\>ren "Example.url.txt" "Example.url"


If you will be editing .URL files more often, you can add "Notepad.exe", or your favorite text editor, to the "context-menu" you see when you "Right Click" on any ".URL" file.

To do this, you will need to make some simple modifications to your registry. There are a few ways to do this. Here are 2 of them...

Method 1:

Create a ".reg" file with the necessary information and use "regedit.exe" to "import" the ".reg" file.

First, create a new text document and edit it with your favorite text editor. Copy and paste the following into the file:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\IE.AssocFile.URL\Shell\Open URL as Text]
@="Open with Notepad"

[HKEY_CLASSES_ROOT\IE.AssocFile.URL\Shell\Open URL as Text\Command]
@="C:\\Windows\\System32\\Notepad.exe %1"

The above is configured to use "Notepad.exe" as the editor that will be run when you use your new "context-menu" item to edit a ".URL" file. If you want to use a different text editor, make these changes to the above new text document before you save it:

  1. The part that says @="Open with Notepad" defines what will show up in the "context-menu" when you "Right Click" on a ".URL" file. You can change it to whatever "title" you want by changing "Open with Notepad" to "Whatever you want".
  2. The part that says @="C:\\Windows\\System32\\Notepad.exe %1" defines the program that will be run when you use your new "context-menu" item to edit a ".URL" file. You can change it to use your favorite text editor by changing "C:\\Windows\\System32\\Notepad.exe" to the path and name of your desired text editor. Note that you need to double the backslashes ("\") in your path like \\ as shown. Don't forget to leave the "space" and "%1" at the end.

If using "Notepad" is OK with you, then you can leave the file as shown above.

From your text editor, save the new ".reg" file you created. As an example, you could save it as "EditURLfile.reg".

Next, run "Regedit". It will normally be located here: "C:\Windows\regedit.exe".

From within "Regedit", click the menu item: File -> Import, and navigate to select the select the new ".reg" file you created ("EditURLfile.reg") and click OK.

You can now close "Regedit". Now, when you "Right Click" on any ".URL" file, you should see a new item in the "context-menu" to open (edit) the file.


Method 2:

If you are not comfortable using "Regedit" to add the "context-menu", you can do it directly from the Windows "Command Prompt". You will be pasting the following 2 lines into the Windows "Command Prompt":

reg add "HKCR\IE.AssocFile.URL\Shell\Open URL as Text" /t REG_SZ /d "Open with Notepad"
reg add "HKCR\IE.AssocFile.URL\Shell\Open URL as Text\Command" /t REG_SZ /d "C:\Windows\System32\Notepad.exe %1"

The above is configured to use "Notepad.exe". If you want to use a different text editor, make these changes to the 2 lines above.

  1. The part that says "Open with Notepad": Change this to whatever "title" you want for the new "context-menu" item.
  2. The part that says "C:\Windows\System32\Notepad.exe %1": Change this to specify the path and name of your desired text editor. Note that for this method, you need single backslashes ("\") in your path as shown. As above, don't forget to leave the "space" and "%1" at the end.

If using "Notepad" is OK with you, then you can leave the 2 lines as shown above.

  1. Open a Windows "Command Prompt"
    Depending on the "Policies" setup on your computer, you may have to open the "Command Prompt" as "Administrator" ("Right Click" on "cmd.exe" and select . "Run as Administrator").
  2. Paste the above 2 lines (one at a time) into the "Command Prompt" window.
    For each line you paste, you should get a confirmation message displayed:
    The operation completed successfully.

Now, when you "Right Click" on any ".URL" file, you should see a new item in the "context-menu" to open (edit) the file.

1
  • Kevin, you answer is very interesting but I preferred the answer from Scott becasue is very quick to act. But thank you very much! Feb 21, 2014 at 16:13
1

For URL files you can just right click them and select "Properties", and in the window select the "Web Document" tab and here you can edit the URL.

EDIT: If you want to open the actual file to change other things than the actual URL you can just drag and drop the .URL file onto notepad or notepad++.

3
  • I know but it is not enough: I need to access the file as text to edit it like in this doc: fmtz.com/formats/url-file-format/article Feb 20, 2014 at 13:01
  • I've updated my answer, so it also says how to do what you want to do. Feb 20, 2014 at 15:02
  • (Thanks for your efforts, Patrick) I tried the drag&drop method but I see a "proibhition icon" when I drag on the window of Notepad++. I tried to open Notepad++ with administrators right but nothing changed. I feel stupid -_- Feb 20, 2014 at 20:52
1

Right click the file, and then choose "open with notepad".

It is just a text file.

3
1

Another way is to open Notepad, then drag the .URL file on the window.

2
  • tried the drag&drop method but I see a "proibhition icon" when I drag on the window of Notepad++. I tried to open Notepad++ with administrators right but nothing changed Feb 21, 2014 at 11:23
  • I think it works for Notepad but not Notepad++.
    – LawrenceC
    Feb 21, 2014 at 12:33
0

If the URL file points to a valid file (like a text file) opening directly with notepad will open the shortcut file pointed to. To edit the actual url file, shift + right click on some whitespace in the folder the 'url' file is in (not on an actual file, you want the white space). Click 'open file location in [command prompt/powershell]'.

Once command prompt (or powershell) is open, run

notepad.exe filenamehere.url

You can use dir first to see the full filename with extension.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .