.bat file hangs

finsfree

Member
I have created a simple bat script to copy some files from one location to another. After I run the bat file the command prompt shows up and just hangs there blank. The commands do run just fine, but I'm left with a black hangs command prompt.

Is there something in the script that I can add to the end to make that black screen not hang there?
 

finsfree

Member
Nope, tried that.

I'm running this script as a scheduled task in an application called, "Windows Shutdown Assistant".
 

Trizoy

VIP Member
Could you be hanging on the last command? Example, it could be asking if you want to overwrite files..

Also, maybe how it's being called? Try double clicking the batch file, if it closes when done, it's probably being called with a CMD /K

CMD /C Run Command and then terminate

CMD /K Run Command and then return to the CMD prompt.
 

Cromewell

Administrator
Staff member
Could you be hanging on the last command?
That would be my guess too. A long running command. A batch file spawned from explorer should auto close on completion unless you do something like pause to keep the window open.
 
Top