Batch-101 Flashcards
What are the types of Commands we have in Batch?
Internal : DIR, COPY, DEL
External: Format, Undelete, Backup
Which keyword to use for comment
REM
Which command to use forEcho
ECHO
How can we made the echo off
ECHO OFF
How can we prevent a particular command to still be shown but get executed
USe @ before the keyword
How can we pause for user reaction?
Do ECHO Warning: Statement PAUSE
What REM command does?
It will delete *.doc file in the folder
What does autoexec,bat does?
It gets executed every time the windows starts, it takes data from Path variable and run the commancd accordingly
How to capture the param from the command line?
Use %1, %2 and keep the counting with the no of params passed
Which command is used to comeout to windows back?
EXIT
So java, mongo and the like has batch utility to run and execute?
Exactly
What is the command for For Loop
FOR %%A in (items) DO …
Can we have %%[0-9] IN (items) DO…
NO only letters
What is the syntax for IF
IF [NOT] EXIST (ECHO…)
Can we Goto commancd
Yes, IF EXISTS C:/text.txt GOTO ME GOTO END
:ME ECHO ME End