Windows

How can I make a .bat program close itself after it opens a file?

Some people like to use bat files to open programs and files in Windows 10 or older versions. However they will soon experience that the .bat program stays open until the process it started has been closed.

In this article we will explain how to do this simply and without too many complicated steps. There is no reason to download all kinds of third-party apps. Windows simply supports this from itself.

Use the start command

When creating the .bat file ensure to use the START command and not just the path to the program. For example

C:\WINDOWS\system32\notepad.exe

Won’t work but if you use the start command and add the parameter \b then it should work, just like below

start C:\WINDOWS\system32\notepad.exe

Give it a try for yourself and you will see that this works perfectly. We hope this very short article helped you on how to create a bat file that starts a program and then closes itself.

If you need more help then feel free to ask in the comments below.

Leave a Reply

Your email address will not be published. Required fields are marked *