In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Xiaobian to share with you how to use the goto call command in cmd batch processing, I believe most people still do not know how to use it, so share this article for your reference, I hope you have a lot of harvest after reading this article, let's go to understand it together!
How to use the goto command
Directs cmd.exe to labeled rows in the batch program.
GOTO label
label Specifies a text string used as a label in the batch program.
Labels must be on a single line and start with a colon.
If command extensions are enabled, GOTO changes as follows:
GOTO command now accepts target tag:EOF, which transfers control to current
End of batch script file. Exit batch script file without definition, this is an easy
Methods. For an extended description of the CALL command that makes this feature useful, type
CALL /?。
We need to know how to use the call command.
Call another batch program from a batch program.
CALL [drive:][path]filename [batch-parameters]
batch-parameters Specifies command-line information required by the batch program.
If command extension is enabled, CALL changes as follows:
The CALL command now accepts labels as targets for CALL. The syntax is:
CALL:label arguments
A new batch file context is created with the specified parameters, controlled by the label specified
Then pass it to the statement. You must "exit" twice by reaching the last two times of the batch script file.
The first time you read to the end of the file, control reverts to immediately after the CALL statement. the second
The batch script exits. Type GOTO /?, See the description of GOTO :EOF extension,
This description allows you to return from a batch script.
Additionally, batch script text parameter references (%0,%1, etc.) have been changed as follows:
%* in batch script indicates all parameters (e.g.%1%2%3%4%5...)
Substitution of batch parameter (%n) has been enhanced. You can use the following syntax:
%~1 -Remove quotes ("), extend %1
%~f1 -expands %1 to a fully qualified pathname
%~d1 -Extend %1 to one drive letter only
%~p1 -extend %1 to only one path
%~n1 -Extend %1 to a file name only
%~x1 -extend %1 to only one file extension
%~s1 -Extended path contains only short names
%~a1 -extend %1 to file attributes
%~t1 -Date/time %1 was extended to file
%~z1 -Extend %1 to file size
%~$PATH:1 -Find directories listed in PATH environment variable and replace %1
Expand to the first fully qualified name found. if
Environment variable name not defined, or file not found,
This modifier expands to an empty string
Modifiers can be combined to achieve multiple results:
%~dp1 -extend %1 only to drive letters and paths
%~ nx1-extend %1 to file name and extension only
%~dp$PATH:1 -Find %1 in directories listed in PATH environment variable,
And expand to the drive letter and path of the first file found.
%~ftza1 -expands %1 to DIR-like output lines.
In the example above,%1 and PATH can be replaced with other valid values.
%~ Syntax terminated by a valid parameter number. %~ Modifier cannot match %*
use
The above is "cmd batch processing goto call command how to use" all the content of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.