Large String

Started by DGOODALE, October 18, 2021, 11:45:18 AM

Previous topic - Next topic

DGOODALE

Is there any way around the 2048 char limit of a string?  I'm bumping up a 3101 error when trying to create a string to build a command line.
cmd='"D:\ps\%script%" -CN "%subjname%" -SAN "DNS=%subjname%","DNS=%sans%" -CAName "<hostname>\<CA Name>" -Verbose'

The variable in the mix is %sans% which could have from 1 to 40 fqdn hostnames which could throw the total char count > 2048

td

This is an easy one. Don't use substitution. Use the StrCat function instead.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

DGOODALE

Perfect.  Worked like it should.

td

You can also use the concatenation operator which is a colon. It works just like StrCat but seems to take some users a bit of getting used to.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade