Relatively simple thing here without a readily discoverable answer...I've tried variations of start, /K flags, etc etc, but whenever my batch file hits the servicecontroller
line and runs that command it completes the command but doesn't do anything after. Please advise.
cd c:\blackboard\tools\admin
servicecontroller.bat services.stop
echo ! ! ! Blackboard services have successfully stopped. It is now safe to shut down the computer or database server. ! ! !
timeout /15
batch files have no memory where any particular line came from. If you execute another batch file from within a batch file, the original file is essentially "gone".
foo.bat:
echo in foo
bar.bat
echo called bat <--never called
bar.bat:
echo in bar
baz.bat:
echo in baz
call bar.bat
echo back in baz <--will be called
Note the call
in baz.bat
. It's vaguely/kinda/sorta the difference between goto
and gosub
. goto unconditionally transfers control to the new location, while "gosub" allows for a "return" to the original calling context.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With