{"id":1390,"date":"2009-05-13T08:00:53","date_gmt":"2009-05-13T16:00:53","guid":{"rendered":"http:\/\/www.sapien.com\/blog\/?p=1390"},"modified":"2009-05-08T11:57:35","modified_gmt":"2009-05-08T19:57:35","slug":"registering-primalpad-as-your-default-editor","status":"publish","type":"post","link":"https:\/\/dev.sapien.com\/blog\/2009\/05\/13\/registering-primalpad-as-your-default-editor\/","title":{"rendered":"Registering PrimalPad as your default editor"},"content":{"rendered":"<p>Associating a file type with a specific application has always been fairly easy to do under the various incarnations of Windows. Basically, you can right-click on a file of the type you wish to use, select the Open With | Choose Program context menu option, then select the program like PrimalPad from the list or browse for the executable. Checking the &#8220;Always use the selected program to open this kind of file&#8221;\u00a0permanently\u00a0associates the &#8220;Open&#8221; verb with the selected file type.<\/p>\n<p>But what if you don&#8217;t want to change the default association command? This happens frequently when the file type can be both edited and &#8220;executed&#8221;, as with a script file. What are your options then? In that case, a little registry manipulation is in order. As with any registry editing tasks, making changes to the registry can potentially damage your system. You should back up your registry before you make any changes.<\/p>\n<p>Run Regedit and locate the registry key &#8220;HKEY_CLASSES_ROOT\\SystemFileAssociations\\text\\shell&#8221;. When you open that key you may already find several verbs in place, probably at least &#8220;Open&#8221; and maybe &#8220;Edit&#8221;. You can add your own verbs to the\u00a0HKEY_CLASSES_ROOT\\SystemFileAssociations\\text\\shell. We will add the verb &#8220;Edit with PrimalPad&#8221; to this key.<\/p>\n<div id=\"attachment_1401\" style=\"width: 310px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1401\" class=\"size-medium wp-image-1401 \" title=\"picture-2\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2009\/05\/picture-2-300x120.png\" alt=\"Creating a new comman\" width=\"300\" height=\"120\" srcset=\"https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2009\/05\/picture-2-300x120.png 300w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2009\/05\/picture-2.png 693w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><p id=\"caption-attachment-1401\" class=\"wp-caption-text\">Creating a new command<\/p><\/div>\n<p>Right click on the\u00a0HKEY_CLASSES_ROOT\\SystemFileAssociations\\text\\shell key and select the NEW | KEY context menu\u00a0option. When the appears change its name to &#8220;Edit with PrimalPad&#8221; and press Enter. Now select the key you just created, right click and select NEW | KEY and name that new key &#8220;command&#8221;. Select the new &#8220;command&#8221; key. In regedit&#8217;s\u00a0right\u00a0hand pane, you should see a default string with its data set to &#8220;(value not set)&#8221;. Right click on the default string and select MODIFY from the context menu. Within the Edit String dialog, set the Value data to the following:<\/p>\n<p>&#8220;&lt;Path to PrimalPad&gt;\\PrimalPad.exe&#8221; &#8220;%1&#8221;<\/p>\n<p>including the quotes, where &lt;Path to PrimalPad&gt; is your local path to the PrimalPad.exe file.<\/p>\n<div id=\"attachment_1402\" style=\"width: 395px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1402\" class=\"size-full wp-image-1402 \" title=\"picture-3\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2009\/05\/picture-3.png\" alt=\"Edit with PrimalPad\" width=\"385\" height=\"169\" srcset=\"https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2009\/05\/picture-3.png 385w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2009\/05\/picture-3-300x131.png 300w\" sizes=\"auto, (max-width: 385px) 100vw, 385px\" \/><p id=\"caption-attachment-1402\" class=\"wp-caption-text\">Edit with PrimalPad<\/p><\/div>\n<p>There is one other thing that you need to keep in mind. Your file extension needs to be associated with the PerceivedType of &#8220;text&#8221; in order for the above to work right. So look for your file extension under\u00a0HKEY_CLASSES_ROOT\\; e.g. if your file extension is .ps1 look for<\/p>\n<p>HKEY_CLASSES_ROOT\\.ps1<\/p>\n<p>Select that key (or create it if does not exist) and look at the PerceivedType string value. Make sure that it is set to &#8220;Text&#8221; or create that value if it does not exist.<\/p>\n<div id=\"attachment_1400\" style=\"width: 310px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1400\" class=\"size-medium wp-image-1400 \" title=\"picture-1\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2009\/05\/picture-1-300x102.png\" alt=\"PercievedType\" width=\"300\" height=\"102\" srcset=\"https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2009\/05\/picture-1-300x102.png 300w, https:\/\/dev.sapien.com\/blog\/wp-content\/uploads\/2009\/05\/picture-1.png 547w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><p id=\"caption-attachment-1400\" class=\"wp-caption-text\">PercievedType<\/p><\/div>\n<p>At this point, everything should all be working and right clicking on your file should give you the &#8220;Edit with PrimalPad&#8221; option, which, when selected, should launch PrimalPad with your file as contents.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Associating a file type with a specific application has always been fairly easy to do under the various incarnations of Windows. Basically, you can right-click on a file of the type you wish to use, select the Open With | Choose Program context menu option, then select the program like PrimalPad from the list or [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[485,2,283],"tags":[28,486,57,996],"class_list":["post-1390","post","type-post","status-publish","format-standard","hentry","category-community-tools","category-general","category-howto","tag-powershell","tag-primalpad","tag-scripting","tag-vbscript"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/1390","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/comments?post=1390"}],"version-history":[{"count":15,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/1390\/revisions"}],"predecessor-version":[{"id":1409,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/1390\/revisions\/1409"}],"wp:attachment":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/media?parent=1390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/categories?post=1390"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/tags?post=1390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}