Wolfram Script Console Doesn't Close Automatically on Windows

I'm not exactly sure how Wolfram Scripts are supposed to work. So I wrote a simple one to configure MaTeX for me so that all I have to do is double click it on a system where I've installed Mathematica 11.3 in order to get MaTeX installed and working. However, when I run the code by double clicking the .wls script file on Windows 10, a black box pops up and never disappears; it looks like this:

Notice how, even though all the code finished executing, the console window stayed open. This is undesirable. Is there anything that I can put at the end of my Mathematica .wls script file to tell the console window to close immediately after running? I tried putting the line "exit" at the very end of the script, but this still didn't work either.

• Quit instead of exit perhaps?
– ktm
Jul 26 '18 at 21:00
• @user6014, alas, none of "Quit", "quit", "Exit", or "exit" make the console window close after running. Jul 26 '18 at 21:01
• Try running 'exit' as an external command? reference.wolfram.com/language/tutorial/ExternalPrograms.html Jul 31 '18 at 6:32
• Unfortunately, that command has not worked for me either. Aug 4 '18 at 17:14