0

I like to add "C:\Windows\System32\drivers\etc\hosts" to the pinned documents of my text-editor (PSPad) on the taskbar.

Usually I only need to open a document and after that it shows ab in the recent documents list of this app in the taskbar. But the hosts file does not show up. I think because it has no extension?!

As you can see I have the document linux_cmd.txt added to this list: enter image description here

I tried to search for this filename in regedit but could not find any entries. Where does Windows 10 save this list or is there an other way to add the hosts file to it?

3

2 Answers 2

1

I solved it as follows:

  • Opened regedit
  • searched for pspad to find extensions that are default for this text editor
  • found .sh with the default value sh_auto_file
  • added a new key to Computer -> HKEY_CLASSES_ROOT with the name .
  • added the string value sh_auto_file
  • signed out/in Windows 10 user to load registry changes
  • opened "C:\Windows\System32\drivers\etc\hosts"
  • and now its part of the recent documents list and can be pinned:

enter image description here

1

My solution is based on @mgutt's, with a few tweaks:

  1. Create a new registration file with a text editor and save as pin_noext.reg:

    Windows Registry Editor Version 5.00
    
    ; Add new key for files without extension
    [HKEY_CLASSES_ROOT\.]
    @="noext_auto_file"
    
    ; Retain file type name
    [HKEY_CLASSES_ROOT\noext_auto_file]
    @="File"
    
    ; Retain blank document icon
    [HKEY_CLASSES_ROOT\noext_auto_file\DefaultIcon]
    @="%SystemRoot%\\System32\\imageres.dll,2"
    
    ; Associate no-extension files with text editor (Notepad++)
    [HKEY_CLASSES_ROOT\noext_auto_file\shell]
    [HKEY_CLASSES_ROOT\noext_auto_file\shell\open]
    [HKEY_CLASSES_ROOT\noext_auto_file\shell\open\command]
    @="\"C:\\Program Files (x86)\\Notepad++\\notepad++.exe\" \"%1\""
    
  2. Import pin_noext.reg into the registry.

  3. Reboot (or terminate-restart C:\Windows\Explorer.EXE)
    Refresh Windows Explorer (using NirCmd): nircmd.exe shellrefresh
  4. Open no-extension file (e.g., C:\Windows\System32\drivers\etc\HOSTS) with chosen text editor (Notepad++ in my case). The file will now appear in the text editor's jump list.
  5. Pin it! ( Win7 ) ( Win10 )

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .