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.

Yuri Pustjens
About the Author

2014, 2015, 2016, 2017 and 2018 Microsoft Most Valuable Professional Windows
Yuri specializes in troubleshooting (crash analysis and devices), system resource utilisation and system performance. He is also very interested in Customer Security. Yuri can be found as Windows Community Moderator and Wiki Author on Microsoft Answers and is active on different communities all across the web.

Leave a Reply

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