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

Using Parameters for Batch File Flexibility

Using Parameters for Batch File Flexibility

Most command-line utilities require extra information such as a filename (for example, when you use COPY or DEL) or a folder path (such as when you use CD or MD). These extra pieces of information—they’re called parameters—give you the flexibility to specify exactly how you want a command to work. You can add the same level of flexibility to your batch files. To understand how this works, first look at the following example:

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


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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