Put Validation on Filename using batch script -
i have bat file eg. test.bat have period attached. example test.bat_mar-15_mar want put validation if first month i.e. mar = second month in file i.e. mar, run test.bat file else generate message - invalid filename. month should match in correct case well. file test.bat_mar-15_apr or test.bat_mar-15_mar treated invalid filename. believe need call test.bat in validation script.
regards audi
there mistakes in
if exist !month1!==!month2! echo true else echo false
firstly, mustn't write exist because compare month1 , month2. exist used check whether file exist. these situations different. secondly, must use () if block (echo true). finally, code must like:
if !month1!==!month2! (echo true) else echo false
and advise see explanation of if. because answer exists in there.
Comments
Post a Comment