I want to check if count exists in mycountry or not, and then do some operations according.
My code snippet :
rem @ECHO OFF
cls
SET FILE="mycountry"
If true I want to run 3 statements and if false I want to run 3 other statements.
I have tried this combination:
Echo.%FILE% | findstr /C:"count">nul && (Echo.TRUE) || (Echo.FALSE)
But how to write multiple statements if the condition gets true? I don't wanna use any flag variable.
Below snippet is not working.
Echo.%FILE% | findstr /C:"count">nul &&
(
Echo.TRUE
echo "ran correct."
)
|| (Echo.FALSE)
&& (...and also) || (...BTW here it doesn't matter, but don't inject a space in front of the pipe symbolEcho.%FILE%| findstrEcho.%FILE% | findstr /C:"count">nul && (Echo.TRUE) || (Echo.FALSE), which has parentheses on the correct line, and therefore does not exhibit the issue! My suspicion is that they've not provided accurate information in their question body.I have tried this combinationversusBelow snippet is not workingthat the 1st did work, the latter not.