Monitor if files have been inserted into a specific folder

0

Good morning, friends,

I would like an opinion or suggestion of you in the second situation:

On one of the company's clients who work the responsibility for the financial sector daily downloads a file from the bank's website. After download this file should be in a specific folder. We in IT need to monitor whether the file is being downloaded and inserted into the folder daily. Today we need connect remotely and see if the file is in the folder. I would like to automate this process, somehow being warned that the file has been inserted into the folder because if we do not receive this warning we will consider that the file has not been downloaded, anyway .. that would be it.

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

obs. the client OS is windows.

    
asked by anonymous 27.08.2018 / 16:09

1 answer

0

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

Create a file named verify.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 and just apply the best to meet you.

    
28.12.2018 / 16:25