I've got a batch file that will move files from a folder to an archive
folder, create more html files and put them in the folder it just cleaned
up. Then email certain people a link to that folder.

The batch file calls a couple of vb scripts, one to do the emailing and one
to clean up the archive folder.

I would like to modify it so it will put in the email the number of files or
the partial name of the files it creates and puts in the folder. Ideally I
would like to have a partial name of the file written to the body of the
email but I guess I can live with the number of files.


Novice at scripting, I've gotten this far by copying and modifying other vb
scripts.

Can someone get me started?

TIA
DDS

Re: Count\list files in a folder by Ayush

Ayush
Fri Dec 15 20:30:00 CST 2006

Replied to [Danny Sanders]s message :
> I would like to modify it so it will put in the email the number of files or
> the partial name of the files it creates and puts in the folder. Ideally I
> would like to have a partial name of the file written to the body of the
> email but I guess I can live with the number of files.
>
>
> Novice at scripting, I've gotten this far by copying and modifying other vb
> scripts.


Hello Danny, if you post the VBS file that emails then i or someone else will give
you the exact VBS file that you can Copy/Paste. For now, you can get the hint how to
do it by this vBs :

'- - - -----------------------
FolderPath="C:\Windows"

Set oSF = CreateObject("Scripting.FileSYStemOBJect")
Set foldr=oSF.GetFolder(folderPath)
Set fils =foldr.Files
FName=""
FCount=0
For Each fL in fils
FCount=FCount+1
FName=FName & fL.Name & vbCrLf 'Or "<br>"
Next
msgBox "There are "&FCount&" files in folder " &FolderPath
msgbox "File Names are : " & vbCrLf & "-----------------" & vbCrLf & FName
'- - --------------------------

? Ayush [ Good :-) Luck ]
-------------
Search - www.Google.com | Wikipedia - http://en.wikipedia.org
Snip your long urls - http://snipurl.com/
-------------

Re: Count\list files in a folder by Danny

Danny
Mon Dec 18 10:11:48 CST 2006

Thanks Ayush,

Here is the "sanitized" vbs file that does the emailing:

Set objEmail = CreateObject("CDO.Message")
objEmail.From = "Someone@ciber.com"
objEmail.To = "Someone@ciber.com"
objEmail.Subject = "The DFSR health reports are ready"
objEmail.Textbody = "Today's DFSR health reports are ready for review in
\\link_to_location_of_files"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"My email server.ciber.cbr.inc"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send


I'll see what I can figure out from your example.

Thanks very much.

DDS

"Ayush" <"ayushmaan.j[aatt]gmail.com"> wrote in message
news:OUGBboLIHHA.4216@TK2MSFTNGP06.phx.gbl...
> Replied to [Danny Sanders]s message :
>> I would like to modify it so it will put in the email the number of files
>> or the partial name of the files it creates and puts in the folder.
>> Ideally I would like to have a partial name of the file written to the
>> body of the email but I guess I can live with the number of files.
>>
>>
>> Novice at scripting, I've gotten this far by copying and modifying other
>> vb scripts.
>
>
> Hello Danny, if you post the VBS file that emails then i or someone else
> will give you the exact VBS file that you can Copy/Paste. For now, you can
> get the hint how to do it by this vBs :
>
> '- - - -----------------------
> FolderPath="C:\Windows"
>
> Set oSF = CreateObject("Scripting.FileSYStemOBJect")
> Set foldr=oSF.GetFolder(folderPath)
> Set fils =foldr.Files
> FName=""
> FCount=0
> For Each fL in fils
> FCount=FCount+1
> FName=FName & fL.Name & vbCrLf 'Or "<br>"
> Next
> msgBox "There are "&FCount&" files in folder " &FolderPath
> msgbox "File Names are : " & vbCrLf & "-----------------" & vbCrLf & FName
> '- - --------------------------
>
> ? Ayush [ Good :-) Luck ]
> -------------
> Search - www.Google.com | Wikipedia - http://en.wikipedia.org
> Snip your long urls - http://snipurl.com/
> -------------



Re: Count\list files in a folder by Ayush

Ayush
Mon Dec 18 10:57:59 CST 2006

Replied to [Danny Sanders]s message :
> Thanks Ayush,
>
> Here is the "sanitized" vbs file that does the emailing:
::snipped::

'- - - - - - - - - - - - - - - - -
FolderPath="C:\Windows"

Set oSF = CreateObject("Scripting.FileSYStemOBJect")
Set foldr=oSF.GetFolder(folderPath)
Set fils =foldr.Files
FName="";FCount=0
For Each fL in fils
FCount=FCount+1
FName=FName & fL.Name & "<br>"
Next

Set objEmail = CreateObject("CDO.Message")
objEmail.From = "Someone@ciber.com"
objEmail.To = "Someone@ciber.com"
objEmail.Subject = "The DFSR health reports are ready"
objEmail.Textbody = "Today's DFSR health reports are ready for review in
\\link_to_location_of_files <br><br> There are " & FCount & " files. File Names :
<br>" & FName
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"My email server.ciber.cbr.inc"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send


'- - - - - - - - - - - - - - - - - -
Change the FolderPath to the path of the folder....

From your script, i changed the Textbody and added some <br> (for new line, works in
HTML) and variables ( file names and number of files) to it.


â?? Ayush [ Good :-) Luck ]
-------------
Search - www.Google.com | Wikipedia - http://en.wikipedia.org
Snip your long urls - http://snipurl.com/
-------------

Re: Count\list files in a folder by Danny

Danny
Mon Dec 18 12:36:47 CST 2006

Thanks again Ayush for your help,

I've got everything working. It sends the link, the number of files in the
folder and the name of the files.
The only thing is the "<br>" don't seem to be working.

Here is the output:

Today's DFSR health reports are ready for review in \\Link_to _folder
<br><br> There are 10 files. File Names :
FPT1-DETR-12-18-2006-0900AM.html<br>FPT1-DETR-12-18-2006-0900AM.xml<br>FPT1-MINN-12-18-2006-0900AM.html<br>FPT1-MINN-12-18-2006-0900AM.xml<br>FPT1-RONY-12-18-2006-0900AM.html<br>FPT1-RONY-12-18-2006-0900AM.xml<br>FPT1-SANM-12-18-2006-0900AM.html<br>FPT1-SANM-12-18-2006-0900AM.xml<br>FPT1-SEAT-12-18-2006-0900AM.html<br>FPT1-SEAT-12-18-2006-0900AM.xml<br>



How to not show the "<br>" and have it actually break the line there?


Thanks



"Ayush" <"ayushmaan.j[aatt]gmail.com"> wrote in message
news:%23BR9OXsIHHA.960@TK2MSFTNGP04.phx.gbl...
> Replied to [Danny Sanders]s message :
>> Thanks Ayush,
>>
>> Here is the "sanitized" vbs file that does the emailing:
> ::snipped::
>
> '- - - - - - - - - - - - - - - - -
> FolderPath="C:\Windows"
>
> Set oSF = CreateObject("Scripting.FileSYStemOBJect")
> Set foldr=oSF.GetFolder(folderPath)
> Set fils =foldr.Files
> FName="";FCount=0
> For Each fL in fils
> FCount=FCount+1
> FName=FName & fL.Name & "<br>"
> Next
>
> Set objEmail = CreateObject("CDO.Message")
> objEmail.From = "Someone@ciber.com"
> objEmail.To = "Someone@ciber.com"
> objEmail.Subject = "The DFSR health reports are ready"
> objEmail.Textbody = "Today's DFSR health reports are ready for review in
> \\link_to_location_of_files <br><br> There are " & FCount & " files.
> File Names : <br>" & FName
> objEmail.Configuration.Fields.Item _
> ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
> objEmail.Configuration.Fields.Item _
> ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
> "My email server.ciber.cbr.inc"
> objEmail.Configuration.Fields.Item _
> ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
> objEmail.Configuration.Fields.Update
> objEmail.Send
>
>
> '- - - - - - - - - - - - - - - - - -
> Change the FolderPath to the path of the folder....
>
> From your script, i changed the Textbody and added some <br> (for new
> line, works in HTML) and variables ( file names and number of files) to
> it.
>
>
> ? Ayush [ Good :-) Luck ]
> -------------
> Search - www.Google.com | Wikipedia - http://en.wikipedia.org
> Snip your long urls - http://snipurl.com/
> -------------



Re: Count\list files in a folder by Danny

Danny
Mon Dec 18 14:25:37 CST 2006

Never mind, I figured it out.


Thanks for all your help.


"Danny Sanders" <DSanders@NOSPAMciber.com> wrote in message
news:uKKi6NtIHHA.2632@TK2MSFTNGP06.phx.gbl...
> Thanks again Ayush for your help,
>
> I've got everything working. It sends the link, the number of files in the
> folder and the name of the files.
> The only thing is the "<br>" don't seem to be working.
>
> Here is the output:
>
> Today's DFSR health reports are ready for review in \\Link_to _folder
> <br><br> There are 10 files. File Names :
> FPT1-DETR-12-18-2006-0900AM.html<br>FPT1-DETR-12-18-2006-0900AM.xml<br>FPT1-MINN-12-18-2006-0900AM.html<br>FPT1-MINN-12-18-2006-0900AM.xml<br>FPT1-RONY-12-18-2006-0900AM.html<br>FPT1-RONY-12-18-2006-0900AM.xml<br>FPT1-SANM-12-18-2006-0900AM.html<br>FPT1-SANM-12-18-2006-0900AM.xml<br>FPT1-SEAT-12-18-2006-0900AM.html<br>FPT1-SEAT-12-18-2006-0900AM.xml<br>
>
>
>
> How to not show the "<br>" and have it actually break the line there?
>
>
> Thanks
>
>
>
> "Ayush" <"ayushmaan.j[aatt]gmail.com"> wrote in message
> news:%23BR9OXsIHHA.960@TK2MSFTNGP04.phx.gbl...
>> Replied to [Danny Sanders]s message :
>>> Thanks Ayush,
>>>
>>> Here is the "sanitized" vbs file that does the emailing:
>> ::snipped::
>>
>> '- - - - - - - - - - - - - - - - -
>> FolderPath="C:\Windows"
>>
>> Set oSF = CreateObject("Scripting.FileSYStemOBJect")
>> Set foldr=oSF.GetFolder(folderPath)
>> Set fils =foldr.Files
>> FName="";FCount=0
>> For Each fL in fils
>> FCount=FCount+1
>> FName=FName & fL.Name & "<br>"
>> Next
>>
>> Set objEmail = CreateObject("CDO.Message")
>> objEmail.From = "Someone@ciber.com"
>> objEmail.To = "Someone@ciber.com"
>> objEmail.Subject = "The DFSR health reports are ready"
>> objEmail.Textbody = "Today's DFSR health reports are ready for review in
>> \\link_to_location_of_files <br><br> There are " & FCount & " files.
>> File Names : <br>" & FName
>> objEmail.Configuration.Fields.Item _
>> ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
>> objEmail.Configuration.Fields.Item _
>> ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
>> "My email server.ciber.cbr.inc"
>> objEmail.Configuration.Fields.Item _
>> ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") =
>> 25
>> objEmail.Configuration.Fields.Update
>> objEmail.Send
>>
>>
>> '- - - - - - - - - - - - - - - - - -
>> Change the FolderPath to the path of the folder....
>>
>> From your script, i changed the Textbody and added some <br> (for new
>> line, works in HTML) and variables ( file names and number of files) to
>> it.
>>
>>
>> ? Ayush [ Good :-) Luck ]
>> -------------
>> Search - www.Google.com | Wikipedia - http://en.wikipedia.org
>> Snip your long urls - http://snipurl.com/
>> -------------
>
>



Re: Count\list files in a folder by Ayush

Ayush
Mon Dec 18 14:59:26 CST 2006

Replied to [Danny Sanders]s message :
> Never mind, I figured it out.
>
>
> Thanks for all your help.
>


You are welcome ! And, i am not sure but <br> should work for HTML messages but what
you did to make it work ?

â?? Ayush [ Good :-) Luck ]
-------------
Search - www.Google.com | Wikipedia - http://en.wikipedia.org
Snip your long urls - http://snipurl.com/
-------------

Re: Count\list files in a folder by Danny

Danny
Mon Dec 18 15:27:11 CST 2006

Instead of objEmail.Textbody I used objEmail.htmlbody


Thanks again
DDS
"Ayush" <"ayushmaan.j[aatt]gmail.com"> wrote in message
news:%23ExBKeuIHHA.2236@TK2MSFTNGP02.phx.gbl...
> Replied to [Danny Sanders]s message :
>> Never mind, I figured it out.
>>
>>
>> Thanks for all your help.
>>
>
>
> You are welcome ! And, i am not sure but <br> should work for HTML
> messages but what you did to make it work ?
>
> ? Ayush [ Good :-) Luck ]
> -------------
> Search - www.Google.com | Wikipedia - http://en.wikipedia.org
> Snip your long urls - http://snipurl.com/
> -------------



Re: Count\list files in a folder by Ayush

Ayush
Mon Dec 18 15:30:28 CST 2006

Replied to [Danny Sanders]s message :
> Instead of objEmail.Textbody I used objEmail.htmlbody


OK and if you want to use the plain text, you can use :


.....
objEmail.Textbody = "Today's DFSR health reports are ready for review in
\\link_to_location_of_files " & vbCrLf & vbCrLf & "There are " & FCount & " files.
File Names :" & vbCrLf & "FName
.....


â?? Ayush [ Good :-) Luck ]
-------------
Search - www.Google.com | Wikipedia - http://en.wikipedia.org
Snip your long urls - http://snipurl.com/
-------------

Re: Count\list files in a folder by Danny

Danny
Mon Dec 18 15:57:45 CST 2006

Thanks

"Ayush" <"ayushmaan.j[aatt]gmail.com"> wrote in message
news:eCNAgvuIHHA.3264@TK2MSFTNGP02.phx.gbl...
> Replied to [Danny Sanders]s message :
>> Instead of objEmail.Textbody I used objEmail.htmlbody
>
>
> OK and if you want to use the plain text, you can use :
>
>
> .....
> objEmail.Textbody = "Today's DFSR health reports are ready for review in
> \\link_to_location_of_files " & vbCrLf & vbCrLf & "There are " & FCount &
> " files. File Names :" & vbCrLf & "FName
> .....
>
>
> ? Ayush [ Good :-) Luck ]
> -------------
> Search - www.Google.com | Wikipedia - http://en.wikipedia.org
> Snip your long urls - http://snipurl.com/
> -------------



Re: Count\list files in a folder by How

How
Tue Mar 06 03:44:06 CST 2007

Hi,

Does any one can guide me how can I have a script that can do the following:
1.check number of files in a folder,
2. if more then 300, send a mail out.



"Danny Sanders" wrote:

> Thanks
>
> "Ayush" <"ayushmaan.j[aatt]gmail.com"> wrote in message
> news:eCNAgvuIHHA.3264@TK2MSFTNGP02.phx.gbl...
> > Replied to [Danny Sanders]s message :
> >> Instead of objEmail.Textbody I used objEmail.htmlbody
> >
> >
> > OK and if you want to use the plain text, you can use :
> >
> >
> > .....
> > objEmail.Textbody = "Today's DFSR health reports are ready for review in
> > \\link_to_location_of_files " & vbCrLf & vbCrLf & "There are " & FCount &
> > " files. File Names :" & vbCrLf & "FName
> > .....
> >
> >
> > ? Ayush [ Good :-) Luck ]
> > -------------
> > Search - www.Google.com | Wikipedia - http://en.wikipedia.org
> > Snip your long urls - http://snipurl.com/
> > -------------
>
>
>