• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

SHIFT: A Different Approach to Parameters

SHIFT: A Different Approach to Parameters

Although you won’t be using it until later in this appendix, you should know that there’s another way to handle parameters inside batch files: the SHIFT command. To see how it works, rewrite the PARAMETERS.BAT file to get PARAMETERS2.BAT:

@ECHO OFF
ECHO.
ECHO The first parameter is %1
SHIFT
ECHO The second parameter is %1
SHIFT
ECHO The third parameter is %1


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint