computing
  • 4

Solved IF Exists With Wildcards?

  • 4

I have been writing a batch script that needs to check for the existence of a file and do some action, however the filenames changes daily. I was going use the IF Exist command with *.txt or whatver the extension is, but IF Exist does not support wildcards. Anyone know a way to use IF Exist with wildcards or some other mehtod?

Share

1 Answer

  1. It DOES
    ================
    C:\temp>if exist *.bat echo y
    y

    =====================================
    If at first you don’t succeed, you’re about average.

    M2

    • 0