# Batch Script: Open File with Notepad

Question by Guest | Last update on 2021-05-12 | Created on 2017-06-26

I would like to write a small batch script for Windows that automatically opens a text file (or multiple text files at once) via the text editor of Windows (Notepad).

Is there any command available for this, but I can use? Thank you very much!

You can use the following line for opening a file with the Windows Editor / Microsoft Notepad in your batch script:

notepad C:\path\to\file.txt

With this, the passed file will be opened and the script will wait until you have closed the editor.

If the script should not wait, you can write "start" at the start of the line. Then, the file will be opened and the script will continue without waking:

start notepad C:\path\to\file.txt


Using this command, you can also open multiple files at the same time:

start notepad C:\path\to\file1.txt


This will open the files file1.txt, file2.txt and file3.txt simultaneously in 3 different windows of Notepad. After that, the script will be closed without waiting for one of the windows. If you omit the "start", the script would open all files after each other.
2017-06-27 at 11:35