patrick118
Technical User
Maybe someone can help me with this.
I am new to writing vb scripts so sorry for stupid questions
I want a scripts that checks a folder for the amount of files and the take an action.
Example.
If there are more then 5 files in it do nothing. If there are more then 5 files in it send an email to pietje@pietje.nl
I got this but is is completely wrong
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists("c:\test") Then
Set objFolder = objFSO.GetFile("C:\test")
Else
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "pietje@pietje.nl"
objEmail.To = "klaasje@pietje.nl"
objEmail.Subject = "Check the directory because it is filling"
objEmail.Textbody = "Check the server"
objEmail.Send
End If
Hope someone can help
Patrick
I am new to writing vb scripts so sorry for stupid questions
I want a scripts that checks a folder for the amount of files and the take an action.
Example.
If there are more then 5 files in it do nothing. If there are more then 5 files in it send an email to pietje@pietje.nl
I got this but is is completely wrong
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists("c:\test") Then
Set objFolder = objFSO.GetFile("C:\test")
Else
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "pietje@pietje.nl"
objEmail.To = "klaasje@pietje.nl"
objEmail.Subject = "Check the directory because it is filling"
objEmail.Textbody = "Check the server"
objEmail.Send
End If
Hope someone can help
Patrick