Search code examples
batch-filedigit

How to specify %digit values


I know nothing about bat files and I just received a batch file from a vendor that wants me to replace the values and run the batch.

@ECHO OFF
REM %1 is the name of the machine and SQL instance
REM %2 is the name of the database
REM %3 is the name of the machine 2

I know the names, but I do not know how to tell the bat file what they are


Solution

  • you are not supposed to replace anything. Those REM lines are just telling you, what parameters are expected.
    When the name of the machine and SQL instance is something like Server1-inst05, the name of the database is VendorsBase and the name of the machine 2 is Workstation, you should execute the batchfile (let's call it vendor.bat) like this:

    vendor.bat Server1-inst05 VendorsBase Workstation
    

    vendor.bat internally references those three parameters as %1, %2 and %3

    (that's the very same information given by npocmaka and BNT; just less technical)