Re: stuck copying Images

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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


.



Relevant Pages

  • Re: Modifying AD User attribute
    ... Would you haapened to have a script to do the following: ... username in AD with username in the spreadsheet, ... Dim objRootDSE, strDNSDomain, strNetBIOSDomain ... ' Determine DNS domain name from RootDSE object. ...
    (microsoft.public.windows.server.scripting)
  • Re: MSTSC v6.0 issue
    ... box appear with 192.168.55.2\username instead of just username (as in the ... Try this VB Script. ... Dim objFSO, objFileCopy, objGuyFile ... Dim obj, strUser ...
    (microsoft.public.windows.terminal_services)
  • objFile.Copy making folder read only?
    ... I finally got this script working but now I am getting a 'Permission Denied" ... on the folder Im copying images to after I run it once. ... propted for one username after there are no more pictures. ... Dim objFile ...
    (microsoft.public.scripting.vbscript)
  • Active Directory - ASP - ADO
    ... I am having problems authenticating users on an Active Directory domain ... the username and password altogether, I dont even get an error message. ... It is my understanding that the script below would show a list of all ... dim strQuery, strConn ...
    (microsoft.public.inetserver.iis.security)
  • Re: [Full-disclosure] SSH brute force blocking tool
    ... And just what on God's earth does "SOMEONE LOGGING IN WITH USERNAME SET ... TO A VALID PASSWORD ENTRY" have to do with this script. ... the classic attack is the symlink attack. ...
    (Full-Disclosure)