1

I'm doing some scripting that generates .url files in my C:\temp directory. These files are only 2 lines long. For example, as a test, I created a file C:\temp\test_shortcut.url:

(echo [InternetShortcut] && echo URL=http://www.yahoo.com) > c:\temp\test_shortcut.url

which will generate a file containing (verifiable with notepad):

[InternetShortcut]
URL=http://www.yahoo.com

If double-click the link, I get the expected Yahoo page opening up in Internet Explorer.

If I then override the .url file with something like:

(echo [InternetShortcut] && echo URL=http://www.google.com) > c:\temp\test_shortcut.url

Again, new contents verifiable with notepad. If I open this new link (same filename), then I still end up at Yahoo. If rename the .url file, then I get Google.

If I edit the URL non-programatically via the Explorer property sheet, I can update the URL without renaming the file, but the format of the file contents itself is also updated to a different .url format.

What is the mechanism for caching the target URL for .url files, and how can I clear or update it?

Some additional information, which I think narrows it down to Explorer:

  • if the .url file is opened via cmd /C c:\temp\test_shortcut.url, the .url file contents are used
  • if the .url file is opened via iexplore.exe c:\temp\test_shortcut.url the .url file contents are used

  • if the .url is opened by using start->run->C:\temp\test_shortcut.url the cached version is used

  • if the .url file is opened via double clicking in explorer, the cached version is used
Pete
  • 317
  • 2
  • 13
  • Possible duplicate of [Is Windows caching the URLs of internet shortcut files?](http://superuser.com/questions/521407/is-windows-caching-the-urls-of-internet-shortcut-files), [What makes Internet Shortcut files special?](http://superuser.com/questions/898669/what-makes-internet-shortcut-files-special) ... – Karan Jun 12 '15 at 18:37
  • It is too bad the duplicate doesn't have an accepted answer. – Pete Jun 16 '15 at 15:30

0 Answers0