MS-DOS and Windows command line phone call control


Computer Hope

control enables a user to execute a batch file from within another batch file.


Call is an internal control and is available in the post-obit Microsoft operating systems.

  • All Versions of MS-DOS
  • Windows 95
  • Windows 98
  • Windows ME
  • Windows NT
  • Windows 2000
  • Windows XP
  • Windows Vista
  • Windows seven
  • Windows 8
  • Windows 10
  • Windows 11

Telephone call syntax

Windows 2000, Windows XP, and later syntax

Calls one batch program from another.

CALL [bulldoze:][path]file name [batch-parameters]

If Command Extensions are enabled, CALL changes as follows:

CALL command at present accepts labels as the target of the Telephone call. The syntax is:

Telephone call :label arguments

A new batch file context is created with the specified arguments and control is passed to the statement later the label specified. You must “exit” twice by reaching the finish of the batch script file twice. The first fourth dimension you read the end, control returns to after the Call argument. The second time will exit the batch script. Type
for a description of the GOTO :EOF extension that allows you to “return” from a batch script.

The expansion of batch script argument references (%0, %one, etc.) are changed every bit follows:

%* in a batch script refers to all the arguments (e.g., %1 %2 %iii %4 %5 …)

Substitution of batch parameters (%n) is enhanced. Y’all can now use the below optional syntax:

Popular:   MS-DOS and Windows command line choice command
%~1 Expands %1 removing whatever surrounding quotes (“).
%~f1 Expands %1 to a fully qualified path name.
%~d1 Expands %one to a drive letter only.
%~p1 Expands %one to a path merely.
%~n1 Expands %1 to a file name only.
%~x1 Expands %1 to a file extension merely.
%~s1 Expanded path contains short names only.
%~a1 Expands %1 to file attributes.
%~t1 Expands %1 to date/time of file.
%~z1 Expands %1 to size of file.
%~$PATH:ane Searches the directories listed in the PATH environment variable and expands %ane to the fully qualified proper noun of the start one establish. If the environment variable name is not defined or the file is not found past the search, then this modifier expands to the empty string.

The modifiers can be combined to go compound results:

%~dp1 Expands %1 to a drive letter and path just.
%~nx1 Expands %1 to a file name and extension merely.
%~dp$PATH:ane Searches the directories listed in the PATH environs variable for %ane and expands to the bulldoze letter and path of the get-go ane found.
%~ftza1 Expands %1 to a DIR-like output line.

In the examples above, %1 and PATH tin can be replaced by other valid values. The %~ syntax is terminated by a valid argument number. The %~ modifiers may not exist used with %* parameter.

MS-DOS, Windows 95, Windows 98, Windows ME syntax

Calls one batch programme from another.

CALL [drive:][path]file proper noun [batch-parameters]

The batch-parameters specifies any command line information required by the batch programme.

Call examples

telephone call second.bat

Executes the second.bat batch file from within another batch file.

Popular:   MS-DOS and Windows command line cipher command