Command-line error when passing arguments as a variable
tslagter
Posts: 19 Bronze 2
There appears to be a bug when building the command line argument list dynamically using variables. If an extra space is included at the beginning of a variable, the command fails.
For example, this works fine:
The following fails (note the space in db1):
This error seems to occur for any argument passed as a variable that begins with a space; I originally found this building up a series of "/exclude" switches.
For example, this works fine:
set db1="/db1:database1" set db2="/db2:database2" sqlcompare.exe /s1:server1 /s2:server2 %db1% %db2%
The following fails (note the space in db1):
set db1=" /db1:database1" set db2="/db2:database2" sqlcompare.exe /s1:server1 /s2:server2 %db1% %db2%This returns: "Error: Invalid command-line argument: /database1. ..."
This error seems to occur for any argument passed as a variable that begins with a space; I originally found this building up a series of "/exclude" switches.
Comments
Redgate Software
This is a new script, so I'm not sure if it would have worked with a previous version.
Redgate Software
And, BTW, there doesn't seem to be any indication of a new version beyond 10.2.0.1337 - that's the latest post I see.
Redgate Software