Monitor if files were inserted in a specific folder

Asked

Viewed 68 times

0

Good morning friends,

I would like an opinion or dirty from you in the following situation:

In one of the company’s clients who work in the financial sector daily makes a download of an archive of the bank’s website. After the download this file should stay in a specific folder. We at IT need to monitor whether the file is being downloaded and inserted into the folder daily. Today we need connect remotely and look if the arch is in the folder. I would like to automate this process, somehow be warned that the file has been inserted into the folder because if we do not receive this notice we will consider that the file has not been downloaded, Emfim.. would be that.

Any suggestions ? I read about a software called Directory Monitor, would it solve this demand?...

Obs. the client OS is windows.

  • 3

    your question is out of scope

  • http://www.macoratti.net/vbn5_fsw.htm

1 answer

0

You can create a task on "Task Scheduler" in the client’s windows which will run from time to time with a script. vbs that checks if a particular file exists and if it exists it sends an email.

Create a file called checks.vbs and put the content below:

Option Explicit
Set objFSO = CreateObject("Scripting.FileSystemObject")
nomeArquivo = "c:\teste.txt" 'nome do arquivo do cliente

' verifica se o arquivo existe
If (objFSO.FileExists(nomeArquivo)) Then       
   enviaEmail  'se existir envia email  
Else 
   WScript.Quit() 
End If

Sub EnviaEmail()
   Set objEmail = CreateObject("CDO.Message")
   objEmail.From = "[email protected]" ' <- informe o e-mail de saída 
   objEmail.To = "[email protected]"  ' <- informe para qual e-mail deve enviar
   objEmail.Subject = "Arquivo recebido" ' <- informe o assunto do e-mail
   objEmail.TextBody =  "ARQUIVO RECEBIDO" ' <- informe o texto 
   objEmail.Configuration.Fields.Item _
      ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
   objEmail.Configuration.Fields.Item _
     ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "10.0.0.1" '<-informe seu servidor smtp
   objEmail.Configuration.Fields.Item _
     ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 '<- informe a porta smtp de envio de email
   objEmail.Configuration.Fields.Update
   objEmail.Send   
End sub

I passed the logic now just apply the best way to suit you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.