- A batch file is an automated script containing a sequence of commands executed in serial order, and these commands don’t require user input unless specified.
- You need a text editor like Notepad to create batch files on Windows 11.
- You can view batch files using different native features of Windows 11, including Notepad, Command Prompt, and your browser.
How to Create a Batch File (.Bat) on Windows 11
It’s easy to make a BAT file on Windows 11. You can use the Notepad app or any text editor on your Windows computer. Here’s a step-by-step instruction on how it’s done:
Step 1: Press the Windows key to open the Start Menu.
Step 2: Type Notepad in the search bar and press Enter .

Step 3: Type the command below and press Enter to proceed to the next line. This command disables the display for the entire script, so you don’t see it while it runs.
@echo off

Step 4: Type title and write the title of your batch file. Then, press Enter .

Step 5: Type echo and the text you want to display on the output screen. Then, press Enter .

Step 6: Type pause and press Enter . This indicates the end of the batch file and keeps the Command Prompt window open, which otherwise would have been closed once the command is successfully executed.

Step 7: Click the File option at the top left corner and choose Save as from the context menu.

Step 8: Name the batch file and save it with the BAT extension—for instance, hello.bat .

To run the batch file, head toward its location and double-click on it. A Command Prompt window will appear, showing the output of the batch file.

The above was a simple example of a batch file. Similarly, you can create and run a batch file to perform more complex operations like fixing gpedit.msc missing error .
Open Batch File (.Bat) on Windows 11
There may be situations when you want to view the content of the batch file. It may be because you are suspicious about the file or want to edit its content. Fortunately, various ways to view a batch file on Windows 11 exist. Here are some:
Method 1: Using the File Explorer
The quickest way to view a batch file’s content is through the Windows File Explorer preview option. Here’s how to enable this option and view a batch file using it:
Step 1: Press the Windows + E keyboard shortcut to open the File Explorer.
Step 2: Click the View button at the top and choose Preview pane .

Step 3: Head to the batch file location .
Step 4: Click on the batch file to view its content in the preview pane.

Method 2: Opening With Notepad
While this process will work with any text editor, we show you how to use the built-in Notepad.
Step 1: Navigate to the location of the batch file.
Step 2: Right-click it and select Edit in Notepad .

Method 3: Using Command-Line Tools
Command-line tools like Command Prompt and Windows PowerShell display the output of a batch file and its content. Here’s how to use Command Prompt to view a batch file:
Step 1: Right-click on the batch file and choose Copy as path from the context menu.

Step 2: Open the Start Menu , type Command Prompt in the search bar, and choose Run as administrator from the right pane.

Step 3: Type more , followed by the copied path, and press Enter . So, the command will look like this:
more “copied path”

You’ll see the batch file content in the result.

To view a batch file using PowerShell, follow these steps:
Step 1: Copy the path of the batch file using the steps mentioned above.
Step 2: Launch the Start Menu , type Windows PowerShell , and choose Run as administrator .

Step 3: Type get-content , followed by the copied path, and press Enter . So, the command will look this:
get-content “copied path”

PowerShell will show the content of the batch file in the result.

Method 4: Using a Browser
You can use your favorite browser to view the content of a batch file. Below are the steps to view batch files using Google Chrome.
Step 1: Navigate to the batch file location , right-click on it, and choose Copy as path .

Step 2: Open the Start Menu , type Google Chrome , and press Enter .

Step 3: Paste the copied address in the address bar and delete the double quotes . Then, press Enter .

Google Chrome will display the batch file content.

Method 5: Using Microsoft PowerToys
Microsoft PowerToys helps power users to enhance their productivity. You can also use this tool to view the content of a batch file. You should download and install it, then continue with the steps below. Here’s how:
Step 1 : Launch the Start Menu , type PowerToys in the search bar, and press Enter .

Step 2: Choose Peek from the left sidebar and toggle on Enable Peek .

Step 3: Click the Pen icon next to Activation shortcut.
Step 4: Assign a shortcut key combination to trigger the peek feature. Ensure the shortcut starts with Windows , Alt , or Shift key. Then, click Save .

Step 5: Head to the location of the batch file.
Step 6: Click on the batch file and press the peek feature key combination .
