Several ways to call a windows batch file from another one or from prompt. Which one in which case?

Please Visit: http://lifelongprogrammer.blogspot.com



Several ways to call a windows batch file from another one

http://stackoverflow.com/questions/2607856/several-ways-to-call-a-windows-batch-file-from-another-one-or-from-prompt-which

direct call: called.bat

the batch file will be executed by the current cmd.exe instance (or a new cmd.exe instance if, for instance, double-clicked in Explorer).



using call command: call called.bat

same as #1, only has an effect when used inside a batch/cmd file. In a batch file, without 'call', the parent batch file ends and control passes to the called batch file; with 'call' runs the child batch file, after the child batch finishes, the parent batch file continues with statements following call.



using cmd command: cmd /c called.bat

runs the batch file in a new cmd.exe instance.



using start command: start called.bat

start will run the batch file in a new cmd.exe instance in a new window, and the caller will not wait for completion.



from Google Plus RSS Feed for 101157854606139706613 http://stackoverflow.com/questions/2607856/several-ways-to-call-a-windows-batch-file-from-another-one-or-from-prompt-which

via LifeLong Community

No comments:

Post a Comment