Dos - Goto Command

Card Puncher Data Processing

About

To get more documentation about the Goto command, type on a console:

help goto

The goto command redirects the instruction flow to a labeled line in a batch program.

Syntax

GOTO label

Example

@echo off

Goto myLabel
echo Do I see this ?

:: The label myLabel
:myLabel
echo No You will see this

Output:

No You will see this





Discover More
Card Puncher Data Processing
DOS ErrorLevel - How to manage errors with the exit code ?

This article shows you how to manage error handling with the exit code of DOS. In dos: When the errorlevel is: = 0, then No Error occurred > 0, then an error occurred You can test if with the...
Card Puncher Data Processing
Dos - Command

A command is: a Dos command (See below). of an utility. The DOS command are extended with management tools located in C:\Windows\System32...
Card Puncher Data Processing
Dos - Control Flow

The flow in DOS can be controlled via: Labels that can be called with the goto (inside the script) or call (outside the script) FOR runs a specified command for each file in a set of files
Card Puncher Data Processing
Dos - Label (Line)

statement in DOS. A label is a place-holder in a batch script “”label The label must be at the beginning of a line with a colon. It can be called via: the goto command inside the script the...
Card Puncher Data Processing
How to create a DOS function ? (known also as a subroutine)

functions in dos are: created and named with a label called with the CALL command creating a subroutine exited with the goto command where: arguments are the argument of the subroutine goto...



Share this page:
Follow us:
Task Runner