LKBEN10736: Batch Command line Parameters
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
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!About the Author
Author:
- Keskon GmbH & Co. KGWim 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. He writes knowledge base articles to solve IT problems and publishes them on the Lubby Knowledge Platform.
Latest update: 25/09/2020