variable comparision in a batch file -
i have batch file in need call 2 other batches depending on condition. , condition is, have 2 variables in text file (two strings. eg:2016janfcst , 2016febfcst). have t0 read these 2 variables batch , check if these 2 equal. , if these 2 variables equal have call 1 batch else other one. can let me know how can achieved?
below have tried
@echo off setlocal enabledelayedexpansion set vidx=0 set var1=a set var2=b /f "tokens=*" %%a in (d:testing.txt) ( set /a vidx=!vidx! + 1 set var!vidx!=%%a ) echo !var1! echo !var2! if !var1! == !var2! goto :success else goto :failure
but it's giving me error
syntax of command incorrect
i think if/else off.
i got run following:
if !var1! == !var2! ( goto :success ) else ( goto :failure )
here's looked: http://ss64.com/nt/if.html
Comments
Post a Comment