Batch file commands call subroutine




















A batch script is a file which contains a sequence of command needs to be executed on windows command prompt, batch script is always referred for executing a series of command over the windows command prompt, in Windows operating system it is known as batch script, whereas in Linux it is known as a shell script. When we execute the batch script file over the command prompt, all the command get executed one by one by following the sequence written in the batch file.

Lets save this batch file as test. Comments are very useful to write a description for the command in a large batch file which contains any number of command and reference of another batch file; it makes the batch file easy to understand and modifiable. This will run java demo jar file, just navigate to your java maven base directory and run this batch file.

This batch file will run each of the files which belong to package, test, and deployment respectively; as a separate manageable process and will open a new console to log a command output for each of the batch file. The batch file was a very popular solution to executing a series of command one by one when DOS used to be a very popular operating system, Nowadays also batch script plays a very important role in various tasks such as to automate the configuration of the windows server or to schedule a task.

A subroutine must start with a label a colon [ : ] followed by a label name which appears on a line by itself, and cannot be included a command group. Case differences are ignored when matching labels. For example, the following batch file fragment calls a subroutine which displays the directory and returns:. If the label is not found between the current position and the end of the file, GOSUB will restart the search at the beginning of the file.

If the label still is not found, the batch file is terminated with the error message " Label not found ". For example:. Gosub Sub1 abc 15 "Hello World". The variable names are defined on the label line. Contents Exit focus mode.

Is this page helpful? Please rate your experience Yes No. Any additional feedback? Note Call has no effect at the command prompt when it is used outside of a script or batch file. Submit and view feedback for This product This page. View all page feedback.

In this article.



0コメント

  • 1000 / 1000