Joined: 03 Feb 2006
Location: Bozeman, MT
|Posted: Sat Jun 04, 2011 6:48 pm Post subject: Setting the Default Unknown Action to Textpad in Windows 7
|For a long time (since Windows 98), I have used Textpad on a mixed Windows and unix network. I like to be able to double-click on any old file type and at least get it to open with Textpad. To do that, I have set the default action for unknown file types to Textpad. The out-of-the-box action for Windows in this case is to show the "Open with" dialog, and that's what I will show how to change.
This involves poking around in the registry. One should probably back up the registry before messing with this, but I never found a great way, and so don't. Your mileage may vary.
So, get into regedit.exe.
The HKCR\Unknown\shell\(Default) value is probably set to "openas". Delete the (Default) value "openas" and leave (Default) empty.
Still under HKCR\Unknown\shell\, define a tag "open", and set its default to
|(Default) = Open with Textpad |
Under the new HKCR\Unknown\shell\open\ tag, define a tag named "command", and set its
|(Default) = \path\to\Textpad "%1" |
where, of course, "\path\to\Textpad" is going to be something along the lines of
|C:\Program Files (x86)\TextPad 5\TextPad.exe |
unquoted, and you really do want the quotes around the "%1". Now, under HKCR\Unknown\shell\openas\, I set the default to
|(Default) = Choose... |
since it will show the "Open with" choose-a-program dialog.
Now, a file not set to open with any other program will open with Textpad when double-clicked, and will show "Open with Textpad" as the top, old-faced, default option.
I realize one can always right-click and choose "Textpad" from the context menu, but I do this sort of thing too often to want to mess with that.
Untyped files (no extension) opened across the LAN will get an Eek-Scary-Internet dialog from Windows 7. I would love to find some way to make that go away without disabling all of those sorts of file checks, but I haven't. Right-clicking the "Textpad" context-menu entry does not get Eek Scary Internet. Double-clicking or right-clicking the (bold top entry) "Open with Textpad" does, as does Right-clicking "Choose...". But then, opening untyped files across the network does anyway, even without these changes.
Something like this has worked on every version of Windows I've tried it on: Windows 98, NT2000, XP, and Windows 7. I started out making mods to HKCR\* as well as HKCR\Unknown, but on Win 7, at least, it's not necessary. I can go back to my notes on former Windows versions if anyone feels the need.