I have a Variable in my Batch %rev%
I need to check whether it contains a string "new" or it has a value of random numbers in it.
Any help Appreciated.
I was trying with the below code but it doesnt work.
if /I "%rev%"=="new" (
echo String has new
) else (
echo it doesnt has new
)
you can try with :
if /I "%rev:new=%" neq "%rev%" (
echo String has new
) else (
echo it doesnt has new
)
or with (a little bit slower):
(echo(%rev%)|find /i "new" >nul && (
echo String has new
)||(
echo it doesnt has new
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With