LKBEN10736: Batch Command line Parameters


This article has not been checked!

LKB | Created: 02/04/2020 | Version: 1 | Language: EN | Rating: 0 | Outdated: False | Marked for deletion: False

Author: Wim Peeters - Keskon GmbH & Co. KG

Latest update: 25/09/2020 | Comment:


Symptom

Batch Command line Parameters

Cause

Batch Command line Parameters

Solution

&                           to chain multiple commands in a row

&&                         to chain multiple commands in a row , butt everey command has to set %errorlevel%=0 to enable next command. If Errorlevel is not set or NE 0, the next command will not be processed. 

@echo off              no display of processed lines whilst batch is running, output is still displayed

( commands )        use these to group commands in a logical matter

"" commands ""     use double quotes for commands containig blanks and , and ;

^                         the Escape Sign treats following special sings as text

|                          Pipe makes output of command 1 to input of command 2

/                          used to mark command line parameters ( dir /p  )

< und >                redirection of monitor in- and output to a device or a file (for example CON, LPT1, COM1, PRN, NUL (= nothing) 

         > oder 1>    = redirection of standard output, if file then file will be new or overwritten

         >> oder 1>>    = redirection of standard output, if file then file will be extended or new

         2>              = Standard error output, if file then file will be new or overwritten

         2>>            = Standard error output, if file then file will be extended or new

About the Author

Wim Peeters is electronics engineer with an additional master in IT and over 30 years of experience including time spent in support, development, consulting, training and database administration. Wim has worked with SQL Server since version 6.5. He has developed in C/C++, Java and C# on Windows and Linux in different European countries and different European languages. He writes knowledge base articles to solve IT problems and publishes them on the Lubby Knowledge Platform where he is one of the most important contributors and the main developer.

Disclaimer:

The information provided in this document is intended for your information only. Lubby makes no claims to the validity of this information. Use of this information is at own risk!