I have to write a batch file which search in a default location for existance of file. The file name is dynamic according to date, but the starting part of the name is same for all. And at a time only one file will exist in that folder.
I wrote this code but then it says The system cannot find the file specified. The specified path has the file. I am putting in the code i have written. Can anyone please help.
FOR /F " tokens=* delims= " %%A IN ('DIR /tc D:\CinguLINC\New Folder\*.* ^| FIND "%filex%"') do set file=%%A
Thanks in advance if anyone can help me.