1.

Solve : IF EXIST for multiple filenames?

Answer»

Hi,

I need to chk if file exists fr multiple file names with OR condition:
Is something like this is pocible, coz i m getting error for this below code,

IF EXIST (D:\Test\Test1.log | D:\Test\Test2.log )


can someone help me? Code: [Select]set bool=0
if exist "D:\Test\Test1.log" set /a bool+=1
if exist "D:\Test\Test2.log" set /a bool+=1
if bool GTR 0 (
    echo at least one of test1.log and test2.log exists
    )Would this not work?

Code: [Select]IF EXIST "File1.txt" (
IF EXIST "File2.txt" (
REM COMMANDS for both files GO here
)
)
I'm on my phone so I can't indent, but I don't think I've MADE any ERRORS... I'll check back tomorrow.that's an AND, not OR.



Discussion

No Comment Found