Arthur
Arthur

Reputation: 41

Batch file command line arguments

It seems an '=' sign on an argument splits that argument into two. ie. if I have a batch file a.bat:

echo %1
echo %2

and call it using:

a 1=2

it will give as a result:

1
2

whereas I want it to give:

1=2 for the first argument.

If I put quotes around "1=2" it works however it keeps the quotes in %1.

Any idea how to get 1=2 into %1 ?

Upvotes: 0

Views: 55

Answers (1)

SomethingDark
SomethingDark

Reputation: 14325

To remove the surrounding quotes from an argument, include a ~.

echo %~1

Upvotes: 1

Related Questions