Re: stuck copying Images
- From: "Shamalama1650" <Shamalama1650@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 25 Jul 2005 23:42:03 -0700
Thanks for the direction Marty. This is my first vb script from scratch. I
took your suggestions and now get an "Expected Next" syntax error after the
renaming gets done (several lines afterwards anyway). In fact I can’t even
isolate just that portion of the script to test the prompting/renaming part.
I have included my script in its entirety below. I welcome any
suggestions/critiques if you see anything missing or done incorrectly.
'This should pull all pictures from camera (2 of each user),
'prompt for names in order of photo taken, Save pictures to
'a local directory as promptedusername01.jpg..promptedusername02.jpg,
'delete files on source drive, call CropAndGray.bat, and then
'send a link to PromptedUserName@xxxxxxxxxx
Dim objFso
Dim objFile
Dim objFolder
Dim strSourcePath
strSourcePath = "S:\"
Set objFso = Server.CreateObject("FileSystemObject")
Set objFolder = objFso.GetFolder(strSourcePath)
'Loop through the pictures
For Each objFile In objFolder.Files
'Reset employee picture count if greater than 1 otherwise ask for
'username and increment employee picture count
If i > 1 Then
i = 0
Else
i = i + 1
strUsername = Input("Please enter a username")
End If
'Copy the file to a different folder and rename it using the username and
employee picture count
objFile.Copy "C:\Photo\output\" & strUsername & i & ".jpg",
OverwriteExisting = True
'Something here needs to call c:\photo\CropAndGray.bat
' *have quite found that peice yet**
'From Demonstration script that uses CDO to send email
'from a computer where the SMTP Service has not been installed.
'Sends a link to each UserName that was entered at "UserName"
'Prompt.
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "PictureMan@xxxxxxxxxx"
objEmail.To = "PromptedUserName@xxxxxxxxxx"
objEmail.Subject = "Choose your picture!"
objEmail.Textbody = "\\server\picturechooser.htm"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"mail.domain.com"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
.
- Follow-Ups:
- Re: stuck copying Images
- From: Marty List
- Re: stuck copying Images
- References:
- stuck copying Images
- From: Shamalama1650
- Re: stuck copying Images
- From: Marty List
- stuck copying Images
- Prev by Date: Re: Accessing TypeLib information
- Next by Date: Re: Error Creating an Exchange 5.5 Mailbox
- Previous by thread: Re: stuck copying Images
- Next by thread: Re: stuck copying Images
- Index(es):
Relevant Pages
|