0

Hi Guys,
I've got a small issue passing the string from command line parameter into the variable within the script.
An issue is when the parameter contains an equal mark in the string that brakes the line and the everything after an equal mark is missing. See an example:

script.bat

username=%1
password=%2

echo %username%
echo %password%

::END_SCRIPT

When I run the script as follow:

c:\script.bat John mypass&*(+=word&*
John
mypass&*(+

As you can observe everything after "=" mark has been skipped and variable %password% returns only part of the string mypass&*(+ and word&* is missing.

My question is whether can it be fixed some how and pass the string containing "=" mark from parameter into variable within the script?

Any help, feedback would be appreciated.
Cheers!!
emarcel.

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by hkansal
0

use double quotes to pass the values. But take care that quotes would also be taken as part of value

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.