0

The following if condition acts as IF NOT DEFINED PARAM_INSERT_DATE_US AND IF NOT DEFINED PARAM_UPDATE_DATE_US GOTO END

IF NOT DEFINED PARAM_INSERT_DATE_US IF NOT DEFINED PARAM_UPDATE_DATE_US GOTO END

Where PARAM_INSERT_DATE_US and PARAM_UPDATE_DATE_US are two variables set at the beginning of batch file.

But I want something similar to this:

IF NOT DEFINED PARAM_INSERT_DATE_US OR IF NOT DEFINED PARAM_UPDATE_DATE_US GOTO END

Is there a way to achieve it concisely?

Obviously I can break the if statements into 2 to achieve that behavior but I was looking for a concise format as I need to check for 4 variables or more.

I will appreciate any help.

Thanks.

Mark
  • 3,609
  • 1
  • 22
  • 33
Pollob
  • 29
  • 1
  • 4

2 Answers2

0
:elsewhere

...

if defined PARAM_INSERT_DATE_US IF DEFINED PARAM_UPDATE_DATE_US goto elsewhere
:end

would do the job - arranging the batch that way may be a game...

Magoo
  • 77,302
  • 8
  • 62
  • 84
0

This will work for the situation you have described.

for %%a in (PARAM_INSERT_DATE_US PARAM_UPDATE_DATE_US) do if not defined %%a goto :END
foxidrive
  • 40,353
  • 10
  • 53
  • 68