I don't know how to do this. I want the screen to be on even though I close it. When I close it, the screen goes black and the batch file is no longer executed.
Set a tab under energy options
This can be done in the advanced power options in the classic control panel: "Select what should happen when the computer is closed".
When closing: do nothing selected, the screen goes black and the batch file is no longer executed.