I want to add the "C:\Windows\System32\drivers\etc\hosts" file to the Jump List for notepad.exe on a Windows 7 machine, but since the file does not have an extension there is no default program associated with it. This means it never shows up in the recent list and you also cannot drag it to the task bar to manually pin it to the start list. I've had problems with jump lists before, and there are ways to use the Registry or File system to change how Jump Lists work, but I haven't seen anything to manually edit a jump list yet. Is there any way to force an item to be pinned to the jump list when that item does not have a program associated with it?
OK I did a little playing.
If you give your user write access to the HOSTS file (dangerous if malware runs as you) you can then create a hardlink to the file (as admin) using a .txt extension that you can edit.
Open a cmd prompt as Administrator and use FSUtil to make a hardlink in a folder you have full access to (like your desktop):
fsutil hardlink create C:\Users\%USERNAME%\Desktop\PinnableHosts.txt C:\Windows\System32\drivers\etc\hosts.
You can then open "PinnableHosts.txt" in Notepad and when you edit it, the changes will be reflected in your HOSTS file (and vise versa, since they're linked).
It will (should) then be in the 'recent list' for Notepad, and therefore available to be pinned.
I want to pin a .html file in my text editor, but it never appeared in the list since .html is associated with my browser.
I tried using the fsutil unsuccessfully (the .html file is on the webserver and fsutil doesn't support non-local drives)
I tried using mklink: mklink C:\Users\%USERNAME%\Desktop\PinnableHTML.txt \ServerName\Folder\Page.html But it still didn't show up in the 'Recent' list. (Using the /H hard link switch also fails - non-local NTFS drive)
Finally just changing the program associated with .html to my text editor, opening the file, pinning it, and switching the extension association back, worked.