|Ok, well I read through that and other than a minor change, I believe I am doing this correctly here:|
IF "%5" == Error (SET %5 = ERROR) ELSE (SET %5 = WORKING)
program.exe -n rivendell -table TABLE_DATA -variables "host=%1;location=%2;origin=%3;object=%4;severity=%5"
Output is this:
c:\>batchfile.bat one two three four Error
c:>IF "Error" == Error (SET Error = ERROR) ELSE (SET Error = WORKING)
c:\>program.exe -n rivendell -table TABLE_DATA -variables mc_"host=one;location=two;origin=three;object=four;severity=Error"
This is the only thing I see that I may have been doing wrong. OBVIOUSLY, I am still doing something wrong, as it's still not working, but I didn't see anything from the site that I'm not doing here.
String1 == String2
Specifies a true condition only if String1 and String2 are the same. These values can be literal strings or batch variables (for example, %1). You do not need to use quotation marks around literal strings.
So that tells me that I needed some or could use quotes around the variable, which is %5. I added that and no issues.
I'm using If and providing a condition evaluation. After the evaluation I have a command (set) and if that isn't met, another condition command (else and then set). I've incorporated parentheses for each of the set options and I'm not receiving any errors when this executes as I have echo turned on.
So still doing something wrong, but don't know what that is.