How to add the 'Open with' context menu to BAT and CMD files in Windows 10
Entering a number commands devour your precious time? If you answered yes, then a batch file can serve as your savior when working in Windows 10. The batch file uses the *.BAT and *.CMD extensions and can help users write several commands, which are then executed sequentially.
Advertisеment
The batch files can bring in huge time savings by taking the chore out of retyping commands. Batch files are one of the simplest solutions when it comes to automating routines, changing system settings and launching websites or applications.
CMD files are modern version of batch files. In general, they were created for the same purpose. However, they support the extended set of commands and extensions, and break compatibility with the classic COMMAND.COM command processor. Also, they include different implementation of error handling. With extensions enabled, the commands like PATH, APPEND, PROMPT, SET, ASSOC in a CMD file will always set the ERRORLEVEL environment variable, regardless of errors. BAT files set ERRORLEVEL only on errors.
Create a Batch File
Usually, to create a new batch file, you can either create a new text file and rename its extension every single time to .bat or .cmd, or you can use Notepad. Using Notepad, it is possible to save the entered text as a batch file by selecting the File - Save menu item and typing the filename with the bat extension in quotes. It is necessary to add quotes to save it with the correct extension.
Tip: You can save plenty of time by adding a useful context menu item to create a New -> Batch file. You can just right click the empty space on your Desktop or in any other folder. It will have a new item in the "New" context menu.
Unfortunately, batch files do not have the “Open With” option in Windows 10. Our today’s post explains how to add the “Open With” entry to the context menu of BAT files.
To Add Open with Context Menu to BAT and CMD Files in Windows 10,
- Download the following ZIP archive: Download ZIP archive.
- Extract its contents to any folder. You can place the files directly to the Desktop.
- Unblock the files.
- Double click on the Add Open with to BAT CMD context_menu.reg file to merge it.
- To remove the entry from the context menu, use the provided file Remove Open with to BAT CMD context menu.reg.
You are done!
How it works
The Registry file add the following keys and values:
[HKEY_CLASSES_ROOT\batfile\shell\Open with\command] @="{09799AFB-AD67-11d1-ABCD-00C04FC30936}" [HKEY_CLASSES_ROOT\cmdfile\shell\Open with\command] @="{09799AFB-AD67-11d1-ABCD-00C04FC30936}"
Tip: See how to go to a Registry key with one click.
The {09799AFB-AD67-11d1-ABCD-00C04FC30936} CLSID represents the Open with menu entry. It can be found under the following key:
HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\Open With @="{09799AFB-AD67-11d1-ABCD-00C04FC30936}"
By replacing the asterisk "*" which means 'all files' with the 'batfile' file class which describes the BAT file type in the Registry, you can quickly add the 'Open with' command to batch files in Windows 10. The same trick works for CMD files (the cmdfile file class in the Registry).
That's it!
Related posts:
- Remove Apps From Open With Context Menu In Windows 10
- Remove Open With Context Menu in Windows 10
- Add Open With to URL files in Windows 10
- Disable Look for an app in the Store in Windows 10 and Windows 8
Support us
Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:
If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!
Advertisеment