Computer Hope
Microsoft => Microsoft DOS => Topic started by: shan08ms on October 09, 2014, 01:04:45 AM
-
Hi ,
I am looking for script which will monitor the folder activities,if folder is not updating i will get a alert mail.
Thanks in Advance.
-
Can't say I would try to do that in real time with a batch file.
We use a program at work called WatchDirectory that does this. There are other great programs that do this as well. Just Google search for "Folder Monitor Software".
-
I wrote a batch file to sound a bell on my pc if the specified folder contains a file with zero bytes:
set bell=' bell symbol here, looks like this except round: . '
if exist "pathname\input_file*.dat" (
for /F %%A in ("pathname\input_file*.dat") do If %%~zA equ 0 (
echo %bell%; %bell%; %bell%; %bell%; %bell%;
echo ---------------------------
echo file equals zero
echo ---------------------------
pause
)
)
exit
I'm sure it could be modified to check for other conditions in the folder, and incorporate a time interval.
The batch is executed automatically each time I login because I created a shortcut in the StartUp folder pointing to the location of this batch file. Once a day is sufficient for me to be alerted.
-
Ding Ding Ding...
-
Hi ,
Thanks for the reply,in google already ,but i did't get the more information,that's way i posted here.
my requirement is folder will updated every one min ,if folder is not updating then script will trigger with time stamp.
-
my requirement is folder will updated every one min ,if folder is not updating then script will trigger with time stamp.
It'd help to know what is in the folder.
-
WatchDirectory can do what you want. It has an option called Quiet Events. Basically meaning if something doesn't happen within the folder for a specified amount of time it will execute the task that you have setup for that job.
-
we have some restriction for downloading free softwares,that's way i am searching batch script.please post if any onie having idea about monitoring folder (if folder is not updated then it will give some alert)
-
Full details will help to give you an answer that works, rather than us trying to guess what the situation is.
What is inside the folder? How many files? Names.ext would be useful.
What files are going to appear in the folder? Names.ext would be useful.
-
we have some restriction for downloading free softwares
I never suggested any Free Software. I don't think anyone else in the thread did either.
-
One way to check on this would be use of File Compare and then based on the output from file compare alert you if it doesnt equal an output of No Differences Encountered. Any other output result showing a change would give you indication that it has been altered. To do this you would need to have the same file saved in a test against folder, and this way you can trigger a scheduled task to run the file compare between the known reference file, and the file that is subject to being changed. There are numerous ways to be alerted. You can even be alerted via e-mail vs just a ding sound etc. But e-mail would need installation on a service to handle e-mail from command prompt. Link below shows FC.
http://www.computerhope.com/fchlp.htm