FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Setting the Default Unknown Action to Textpad in Windows 7

Post new topic   Reply to topic    Community Forum Index -> Tips
View previous topic :: View next topic  
Author Message

Joined: 03 Feb 2006
Posts: 9
Location: Bozeman, MT

PostPosted: Sat Jun 04, 2011 6:48 pm    Post subject: Setting the Default Unknown Action to Textpad in Windows 7 Reply with quote

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.
Back to top
View user's profile Send private message

Joined: 31 Jan 2012
Posts: 22

PostPosted: Mon Jan 07, 2013 7:31 pm    Post subject: Reply with quote

This will do it properly with passing the filename through dde - so that Textpad will open the file in the existing window instead of launching a new instance.

Windows Registry Editor Version 5.00



@="\"C:\\Program Files\\TextPad 6\\TextPad.exe\" -s"



Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Community Forum Index -> Tips All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB