Home > other >  How to retrieve script parameters?
How to retrieve script parameters?

Time:10-14

I have the batch file MyBatch.bat and I call it like:

MyBatch.bat -param1=abc -param2="def jkl"

how from MyBatch.bat can I retrieve the value of param1 (abc) and param2 (def jkl)

CodePudding user response:

setlocal
:parmloop
if "%~1" neq "" set "%~1=%~2"&shift&shift&goto parmloop
set -
  • Related