Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
1  
You need to access your hosts file that often? I always kind of though that's why it didn't have an extension, to keep people from (too) easily accessing it with a double-click. :) –  techie007 Mar 19 '10 at 0:32
add comment

3 Answers

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.

HTH.

share|improve this answer
add comment
up vote 2 down vote accepted

Using a hardlink was a good idea and worked great, but I found a better way. Google found this page about default association for files with no extension. I changed it to txtfile, opened the file, pinned it to the jump list and then removed the default association. Problem solved!

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.