{"id":153,"date":"2008-04-04T09:24:15","date_gmt":"2008-04-04T03:54:15","guid":{"rendered":"http:\/\/198.58.113.91\/blog\/change-the-default-editor-for-bat-files\/"},"modified":"2021-06-19T22:10:33","modified_gmt":"2021-06-19T16:40:33","slug":"change-the-default-editor-for-bat-files","status":"publish","type":"post","link":"https:\/\/www.winhelponline.com\/blog\/change-the-default-editor-for-bat-files\/","title":{"rendered":"Change the Default Editor for Batch files in Windows"},"content":{"rendered":"<p>When you right-click on a Windows batch file (.bat<i>) <\/i>file and click Edit, Notepad opens the file by default. If you have a <a href=\"https:\/\/www.winhelponline.com\/blog\/replace-notepad-text-editor-notepad-plus-association\/\" target=\"_blank\" rel=\"noopener noreferrer\">Notepad replacement<\/a> software installed in your system, you can set it as the default editor for Windows batch files.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/bat-icon.gif\" width=\"280\" height=\"68\" hspace=\"2\" \/><!--more--><\/p>\n<h2>Change the Default Editor for Batch Files<\/h2>\n<ol>\n<li>Launch the Registry Editor (<code>regedit.exe<\/code>)<\/li>\n<li>Navigate to the following branch:\n<pre>HKEY_CLASSES_ROOT\\batfile\\shell\\edit\\command<\/pre>\n<\/li>\n<li>Double-click the <code>(default)<\/code> value on the right.<\/li>\n<li>By default, it points to <code>notepad.exe<\/code>. Replace the existing data with the complete path of your editor<i><i><i><i>.<br \/>\n<\/i><\/i><\/i><\/i><strong>Example:<\/strong><\/p>\n<pre>\"C:\\Program Files (x86)\\Notepad++\\notepad++.exe\" \"%1\"<\/pre>\n<p><em>Be sure to include the <code><strong>\"%1\"<\/strong><\/code> at the end (with quotes), as mentioned above.<\/em><\/li>\n<li>Optionally, to change the default editor for .CMD files as well, then make the change in the following key as well:\n<pre>HKEY_CLASSES_ROOT\\cmdfile\\shell\\edit\\command<\/pre>\n<\/li>\n<li>Exit the Registry Editor.<\/li>\n<\/ol>\n<p>When you right-click on a Windows batch file and choose Edit, your chosen editor will now open the batch file for editing.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you right-click on a Windows batch file (.bat) file and click Edit, Notepad opens the file by default. If you have a Notepad replacement software installed in your system, you can set it as the default editor for Windows batch files.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[7],"tags":[441],"class_list":["post-153","post","type-post","status-publish","format-standard","hentry","category-windows","tag-registry"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":8452,"url":"https:\/\/www.winhelponline.com\/blog\/bat-files-do-not-run-when-double-clicked-fix-association\/","url_meta":{"origin":153,"position":0},"title":"[Fix] Windows Batch Files (.bat) do not run when double-clicked","author":"Ramesh","date":"April 2, 2019","format":false,"excerpt":"When you double-click a Windows batch file (.bat) or a .cmd file, one of the following symptoms may happen: The error \"Windows cannot find 'filename.bat'. Make sure you typed the name correctly, and then try again.\" occurs when you run a .bat or a .cmd file. The batch file opens\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"comspec setx","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/comspec-fix-setx.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/comspec-fix-setx.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/comspec-fix-setx.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":3220,"url":"https:\/\/www.winhelponline.com\/blog\/reset-wordpad-notepad-settings-defaults\/","url_meta":{"origin":153,"position":1},"title":"How to Reset Notepad and WordPad to Default","author":"Ramesh","date":"June 7, 2016","format":false,"excerpt":"If you've changed the default font settings and other options in WordPad or Notepad and want to revert back to Windows default values, this post tells you how to do that. Reset Notepad settings If you've altered the default Notepad font or encoding (using the iDefaultEncoding registry value), the margin,\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"reset notepad store app","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/06\/notepad-uwp-app-reset.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":24227,"url":"https:\/\/www.winhelponline.com\/blog\/associate-file-no-extension-program\/","url_meta":{"origin":153,"position":2},"title":"How to Associate a Program with Files that have No Extension","author":"Ramesh","date":"June 18, 2021","format":false,"excerpt":"Shell extensions for file names with no file extension can be registered under the following: [HKEY_CLASSES_ROOT\\.] For example, to associate a program (for example, Notepad.exe) to open all files with no extension, use the following registry keys: [HKEY_CLASSES_ROOT\\.] @=\"\" [HKEY_CLASSES_ROOT\\.\\shell] [HKEY_CLASSES_ROOT\\.\\shell\\open] [HKEY_CLASSES_ROOT\\.\\shell\\open\\command] @=\"<path to notepad.exe> %1\" Here is an alternative\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"associate extension-less files with a program","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2021\/06\/associate-extension-less-files-2.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":8738,"url":"https:\/\/www.winhelponline.com\/blog\/open-with-notepad-plus-right-click-menu-windows\/","url_meta":{"origin":153,"position":3},"title":"Add &#8220;Open with Notepad++&#8221; to the Right-Click Menu","author":"Ramesh","date":"April 19, 2019","format":false,"excerpt":"Many users have replaced Notepad with Notepad++ as the default text editor on their computers. Others use Notepad++ only when needed, and launch it via the Open with menu and choose Notepad++ from the list of options. This post tells you how to add the Open with Notepad++ command to\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"Notepad++ right-click menu in Windows","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/open-with-notepad-plus-registry-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/open-with-notepad-plus-registry-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/open-with-notepad-plus-registry-1.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/open-with-notepad-plus-registry-1.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":24126,"url":"https:\/\/www.winhelponline.com\/blog\/set-default-encoding-notepad-ansi-utf-8\/","url_meta":{"origin":153,"position":4},"title":"How to Change the Default Character Encoding in Notepad","author":"Ramesh","date":"May 23, 2021","format":false,"excerpt":"This post explains how to change the default character encoding in Notepad (e.g., UTF-8 to ANSI) on Windows 10. ANSI has been the default encoding in Notepad in earlier versions of Windows 10. Since Windows 10 version 1903, the default Notepad encoding is UTF-8. When you launch notepad.exe, the default\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"notepad ansi warning unicode","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2021\/05\/wrong-encoding-warning-notepad.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":5732,"url":"https:\/\/www.winhelponline.com\/blog\/replace-notepad-text-editor-notepad-plus-association\/","url_meta":{"origin":153,"position":5},"title":"How to Replace Notepad With Notepad++ or Other Editor","author":"Ramesh","date":"November 2, 2017","format":false,"excerpt":"If you\u2019re looking at how to replace Notepad with Notepad++ or any third-party editor, this post explains how to do it. Notepad++ is a free source code editor and Notepad replacement that supports several languages. Let\u2019s see how you can replace Notepad with Notepad++ without replacing any system files. Notepad\u2026","rel":"","context":"In &quot;Utilities&quot;","block_context":{"text":"Utilities","link":"https:\/\/www.winhelponline.com\/blog\/category\/utilities\/"},"img":{"alt_text":"notepad plus replace debugger notepad.exe","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2017\/11\/debugger-notepad-plus-switch.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2017\/11\/debugger-notepad-plus-switch.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2017\/11\/debugger-notepad-plus-switch.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2017\/11\/debugger-notepad-plus-switch.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/comments?post=153"}],"version-history":[{"count":0,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/153\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/media?parent=153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/categories?post=153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/tags?post=153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}