Draft for Information Only
ContentMS DOS Command: GOTO
MS DOS Command: GOTOReference from Microsoft MS-DOS cmd help DescriptionDirects MS-DOS to a line in a batch program that is marked by a label you specify. You can use this command only in batch programs. The GOTO command directs MS-DOS within a batch program to a line identified by a label. When MS-DOS finds the label, it processes the commands beginning on the next line. SyntaxGOTO label
Parameters
RemarksValid values for labelThe label parameter cannot include separators such as spaces, semicolons or equal signs. GOTO uses the first eight characters of each labelThe GOTO command uses only the first eight characters of a label. Therefore, the labels "hithere01" and "hithere02" are both equivalent to "hithere0". Matching the label parameter with the label in the batch programThe label value you specify on the GOTO command line must match a label in the batch program. The label within the batch program must be preceded by a colon. If your batch program does not contain the label that you specify, the batch program stops and MS-DOS displays the following message: Label not found MS-DOS recognizes a batch-program line beginning with a colon (:) as a label and does not process it as a command. If a line begins with a colon, MS-DOS ignores any commands on that line. Using GOTO for conditional operationsGOTO is often used on the same command line with other commands to perform conditional operations. For more information about using GOTO for conditional operations, see the IF command. ExamplesThe following batch program formats a disk in drive A as a system disk. If the operation is successful, the GOTO command directs MS-DOS to a label named "end".
©sideway ID: 110700193 Last Updated: 7/28/2011 Revision: 0 Latest Updated Links
![]() ![]() ![]() ![]() ![]() |
![]() Home 5 Business Management HBR 3 Information Recreation Hobbies 8 Culture Chinese 1097 English 339 Travel 18 Reference 79 Computer Hardware 254 Software Application 213 Digitization 37 Latex 52 Manim 205 KB 1 Numeric 19 Programming Web 289 Unicode 504 HTML 66 CSS 65 SVG 46 ASP.NET 270 OS 431 DeskTop 7 Python 72 Knowledge Mathematics Formulas 8 Set 1 Logic 1 Algebra 84 Number Theory 206 Trigonometry 31 Geometry 34 Calculus 67 Engineering Tables 8 Mechanical Rigid Bodies Statics 92 Dynamics 37 Fluid 5 Control Acoustics 19 Natural Sciences Matter 1 Electric 27 Biology 1 |
Copyright © 2000-2025 Sideway . All rights reserved Disclaimers last modified on 06 September 2019