Hopefully "ScriptingTipsAndTricks" helps you with your batch file or vbscript scripting :-)
[Bottom][Contents][Prev]: SETLOCAL & ENDLOCAL (used to save & restore state)[Next]: SORT.EXE (allows sorting of output
\->Windows Commands->SHIFT (allows for looping to handle an unknown number of parameters

SHIFT (allows for looping to handle an unknown number of parameters

This command is very useful as you can handle an unknown number of parameters.

See the "unknown number of parameters" example for more information.

SYNTAX: SHIFT /?

Changes the position of replaceable parameters in a batch file.

SHIFT [/n]

If Command Extensions are enabled the SHIFT command supports
the /n switch which tells the command to start shifting at the
nth argument, where n may be between zero and eight.  For example:

    SHIFT /2

would shift %3 to %2, %4 to %3, etc. and leave %0 and %1 unaffected.


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: SETLOCAL & ENDLOCAL (used to save & restore state)[Next]: SORT.EXE (allows sorting of output


ScriptingTipsAndTricks© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Sunday September 07 2014 at 12:50pm
Visit ScriptingTipsAndTricks's Home Page
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.