Does Windows cache the contents of .url (Internet Shortcut) files?

前端 未结 4 1359
有刺的猬
有刺的猬 2021-01-05 01:08

I\'m implementing a custom URL handler in .NET. To test this, I have created a few different .url files and put them on my Desktop. This generally works fine, b

相关标签:
4条回答
  • 2021-01-05 01:50

    Windows 7 Caches your Filenames and sometimes, as you said, the filenames in specific locations.

    Start regedit and search for the following

    HKEY_USERS\S-1-5-21-x-x-x-x\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache
    

    where S-1-5-21-x-x-x-x is your currently logged in User.

    There you can see that most (or all?) files have been cached which you have ever accessed.

    Maybe you can also deactivate the MUICaching programatically. Maybe this site helps you: Disable Caching

    0 讨论(0)
  • 2021-01-05 02:02

    I have a reason to believe that URL files are interpreted by some Internet Explorer component at the time of creation (not biblical). They are only interpreted initially, the first time the file is created. Any modifications to the URL file later on will not be committed. This is because the shortcut is not stored in the file. This is why the file can be modified later on so that it becomes empty, as a 0 byte file and the URL file will appear to be working anyway. The shortcut data is stored in the "Web Document" field as a file property in the NTFS file system. The file merely serves the purpose of pointing to it. You might be able to modify these property fields programmatically, which would supposedly "edit the file". It's a painful exercise just to edit what appears to be a simple text file.

    Additionally, once a file name has been used for a URL file, it cannot be reused for new files, no matter what disk or path you save it to. So you have to keep assigning unique file names, never used previously, for each new URL file you create. This has to do with how Internet Explorer caches web content. It remembers what file names have been used already and maps those names to previously defined URL addresses. To reuse a name (or when you run out of ideas for new and unique file names) you have to clear Temporary Internet Files.

    Windows 7: %localappdata%\Microsoft\Windows\Temporary Internet Files
    Windows 8: %localappdata%\Microsoft\Windows\INetCache
    

    To directly answer your question: yes, it does.

    0 讨论(0)
  • 2021-01-05 02:05

    I've found my desktop .url shortcut contents cached in %LocalAppData%\Microsoft\Windows\Caches.

    There are a few (several?) files with filenames like {<SOME_GUID>}.<x>.ver0x<XXXXXXXXXXXXXXXX>.db. Two of them had the .url files cached.

    Unfortunately, I've found no information on what they are or how to refresh them. Everybody just deletes them as part of some cache clean-up operation.

    0 讨论(0)
  • 2021-01-05 02:14

    I had a similar issue, and it turns out the culprit was Firefox.

    If by chance your web browser is Firefox, your cache directories may be corrupted.

    You can either create a new Profile, or take your chances cleaning things out of C:\Users\<username>\AppData\Local\Mozilla\Firefox\Profiles\<profile>\

    0 讨论(0)
提交回复
热议问题