How can I close it? Improve this question. ChrisM 1, 6 6 gold badges 16 16 silver badges 27 27 bronze badges. Mister Dev Mister Dev 9, 12 12 gold badges 40 40 silver badges 33 33 bronze badges. You should probably change the accepted answer to the one Marshall posted.
Add a comment. Active Oldest Votes. Improve this answer. Marshall Marshall 2, 1 1 gold badge 10 10 silver badges 2 2 bronze badges. This is the correct answer. Thanks, the empty double quotes are exactly what I needed. I have a backup script that I run weekly and would modify it ever so slightly every week, trying to get it to a close my program, b backup my data, and c restart the program and close command prompt. This finally got command prompt to close also prevented my next backup from triggering, I had to close that command prompt!!!
NobleUplift: For me this worked,.. You can use the exit keyword. Here is an example from one of my batch files: start myProgram. Daniel F. Thornton 3, 2 2 gold badges 26 26 silver badges 41 41 bronze badges.
Patrick Desjardins Patrick Desjardins k 82 82 gold badges silver badges bronze badges. Note that this will do not nice things if you are using the console interactively instead of just double-clicking on a batch file.
Generally there is little to no need to ever put exit into a batch file. I tried this command in Win8. I'm not sure if it's different, but note that you must provide it with a Window title as your first parameter. When I would run it the way Patrick described, it would just open a new command prompt with "myProgram. Note that if your command contains spaces and you put it into quotes, you must add an extra quoted parameter before it, as START interprets the first quoted parameter as window name and only the folowing second parameter as command name.
Lasse V. Karlsen Lasse V. Karlsen k 95 95 gold badges silver badges bronze badges. If not, call a vb script wscript. CreateObject "WScript. Shell" WshShell. Community Bot 1 1 1 silver badge. VonC VonC 1. Zosimas Zosimas 4 4 silver badges 13 13 bronze badges. Chris Dail Chris Dail The "title" option is important. If path of the program includes spaces it has to be enclosed by quotes thus we have to add "title" to avoid failure. If you close the main window, the background process 'myprogram.
Gilco Gilco 1, 12 12 silver badges 12 12 bronze badges. This isn't an answer to the question — jeb. Was the solution for me.
The Dos window opens but closes again and the solution works. I don't understand the downvotes i upvoted — JoeFox. Me Either. Gerhard Gerhard This made my day. Now it actually works, otherwise it would only give me the Open With dialog when trying to open a file with exe.
If you want to start multiple executable files, keep in mind that the batch file opens each of the files almost immediately. If you want some delay, consider using the pause command or sleep utility. If the file path contains a space within a folder name, you need to enclose that folder name in double quotes.
For example, if you had Google Chrome installed on your computer and wanted to start the Chrome browser through a batch file, you could use the command below. The Program Files x86 folder name includes spaces in it. Enclosing the folder name in double quotes tells Windows the spaces are part of the folder name. A batch file can only execute or start another program. Once it is started, it cannot perform additional functions within that program.
0コメント