Q:

What does %* mean in a batch file

I have seen the usage of %* in batch files and command lines. Googling did not give me any results. Can some one explain the typical usage of %* with an example.Thanks

A:

It means "all the parameters in the command line".
For example, it's useful when you want to forward the command line from your batch file to another program:
REM mybatchfile.cmd
echo You called this with arguments: %*
echo I will now forward these to the DIR command.
dir %*

A:

One important point not listed in any of the previous answers: %* expands to all parameters from the command line, even after a SHIFT operation.
Normally a SHIFT will move parameter %2 to %1, %3 to %2, etc., and %1 is no longer available. But %* ignores any SHIFT, so the complete parameter list is always available. This can be both a blessing and a curse.

A:

%* expands to the complete list of arguments passed to the script.
You typically use it when you want to call some other program or script and pass the same arguments that were passed to your script.

