BAT to Dectect files

graig

Honorable
Jul 30, 2013
1
0
10,510
Hello,

I would need to have a bat that would detect when a file is present in a folder.. Is it possible ? I could use the windows schedule but don't know how to create the bat file to allow me to check that up... It could be or a pop up to inform me that a file is present in the folder or even to open the file.

many thanks,
Graig
 
Solution
save this as findfile.bat and the command line is "findfile c:\myfolder\myfile.txt" , without quotes.

@echo off
if exist %1
(
do something
)
else
(
echo %1 File Not Found !