How to Add or Remove the ‘Open with’ Context Menu Handler for BAT files in Windows 11. By default, BAT files do not include an “Open with” option in the context menu. This helps protect scripts from accidental edits—but it can slow down troubleshooting and development workflows. Before we begin, be sure to subscribe to NinjaOne’s IT video hub and our YouTube channel for more tech content like this. Why Manage the ‘Open with’ Option for BAT Files. BAT files often contain automation or system-level commands. Hiding the “Open with” option helps preserve script integrity by limiting edits through text editors. However, enabling it can be useful for developers and IT admins who need faster access to code editors for debugging and maintenance. The right configuration depends on whether you prioritize security or flexibility. Managing BAT file context menu options. Users can choose between modifying the registry, using Command Prompt, or scripting via PowerShell. Method 1: Registry Modification. The most direct way to manage this setting is through the Windows Registry. First, open the Registry Editor as Administrator. Then go to HKey Classes Root\batfile\shellex\ContextMenuHandlers To add the “Open with” option, right-click ContextMenuHandlers, then select New > Key. Name the new key OpenWith. To remove the option, right-click the OpenWith key and select Delete. Close the Registry, then refresh the desktop or restart File Explorer to apply the change. Method 2: Using Command Prompt. For repeatable or scripted deployments, Command Prompt is faster and safer than manual edits. Open Command Prompt and run the appropriate command. To add the “Open with” option, Run. To remove the option run. Then restart File Explorer or refresh the desktop to apply the changes. Method 3: Using PowerShell. PowerShell is ideal for remote management and automation. Open PowerShell, then deploy the appropriate script. To remove the Open with option... To add it back. Restart File Explorer to apply the update. For more information, check out our official blog post on How to Add or Remove the ‘Open with’ Context Menu Handler for BAT files in Windows 11 linked in the description below.

How to Add or Remove the ‘Open with’ Context Menu Handler for BAT files in Windows 11

By default, BAT files don’t show an Open with option in the Windows 11 context menu. In this video, learn how to add or remove the open with .BAT file context menu option using Registry Editor, Command Prompt, PowerShell, or Group Policy for secure and flexible script management.

Read the full guide on How to Add or Remove the ‘Open with’ Context Menu Handler for BAT files in Windows 11

Never miss a NinjaOne video!