Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Escape all plus signs in a 3rd party batch file

Jun
31
0
I have a .bat file, written by a 3rd party. It's meant for plain cmd and it uses lots of plus signs "+". Seems that in TCC "+" is a special char, that needs to be escaped ("^" or "&"). Is there a line I can add at start of this bat file to make tcc interpret all plus signs "+" as just regular plus signs (i.e. make it behave like plain cmd)?
 
What version of TCC?

'+' isn't very special in TCC. I can think of only two places where it is used ... in concatenating files with COPY (COPY file1+file2) and in the '%+' representation of the command separator ('&') which has long been deprecated.

How is '+' used in the batch file?
 
Can you post a sample portion of the batch file?

As Vince said, + is not a special character in TCC unless you are using the (deprecated) pseudovariable %+. Go to OPTION / Advanced / Special Characters, and if you have the "Expand pseudovariables" set, uncheck it. Unless you're running a lot of ancient DOS (or 4DOS) batch files, you don't need it.

The only other place a + could be defined as "special" is if you've got a SETDOS command that's redefining it to be a command separator or escape character or parameter character.
 
With apologies to Element, just a quick aside.

Rex, I didn't realize that %+ was deprecated. Is there something else that should be used, or just go with the defined separator.

Michael
 
With apologies to Element, just a quick aside.

Rex, I didn't realize that %+ was deprecated. Is there something else that should be used, or just go with the defined separator.

The reason to use %+ was for people who were writing batch files to be run in both 4DOS and 4NT. That reason is long gone, and you're going to be much happier & have fewer strange interactions w/CMD batch files if you just use the default & separator.
 
I really really really hope they never get rid of %+

There’s no way for a btm file to be truly portable if people disagree on command separator characters❟ other than setting it yourself in each btm file (yuck)
 
I really really really hope they never get rid of %+

There’s no way for a btm file to be truly portable if people disagree on command separator characters❟ other than setting it yourself in each btm file (yuck)

If you set a different command separator character, then you have abandoned any pretense of portability (or compatibility).
 
I mean... %+ works, and if I don’t use & outside of quote marks, it should be fine.

But in truth , the only way any BTM is truly portable would be to define these things within itself.
 
Back
Top