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.urlthe .url file contents are usedif 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