1

I have this problem with my IF query.

IF "!ProzentS_[%Temp_Counter2%]!"LSS"%MIN_THRESHOLD%" (
    set WARTUNG_[%Temp_Counter2%]=true
    ECHO XXXXXXXXXX %DATE:~-4%%DATE:~-7,2%%DATE:~-10,2%_%Time% TEST !WARTUNG_[%Temp_Counter2%]! !BAT_[%Temp_Counter2%]!  >> %PATH_LOGDATEI%\%LOGFILE_NAME%
    )

Somehow it has a problem with the brackets

"(" can not be processed syntactically at this point

if I use "LSS" "EQU" or "GTR" it does not count them but if i put "==" there it works.

IF "!ProzentS_[%Temp_Counter2%]!"=="%MIN_THRESHOLD%" (
)

Can someone tell me why this happens.

2
  • 4
    put spaces around LSS. The parser can not differ between string and comparator without them. Commented Mar 1, 2018 at 8:45
  • you might also want to use %Time: =0% instead of just %Time% to replace the space with a zero (at ` 9:47`) Commented Mar 1, 2018 at 8:47

1 Answer 1

2

you need more space:

IF "!ProzentS_[%Temp_Counter2%]!" LSS "%MIN_THRESHOLD%" (
    set WARTUNG_[%Temp_Counter2%]=true
    ECHO XXXXXXXXXX %DATE:~-4%%DATE:~-7,2%%DATE:~-10,2%_%Time% TEST !WARTUNG_[%Temp_Counter2%]! !BAT_[%Temp_Counter2%]!  >> %PATH_LOGDATEI%\%LOGFILE_NAME%
    )
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.