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

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -