Board index » Visual Studio » Creating a LogFile in VBScript
|
notsureyet
|
Creating a LogFile in VBScript
Visual Studio134
I am creating a VBScript to automate a ftp process for uploading a file. What I need to do is add the correct VBScript code to output a logfile depending on the time and date the file was trasnfered and if it was successful. Here is my current Script: __________________________________________________________ Dim sFtpsite, sUsername, sPassword, sFromFolder, sFileName1 Set oShell = CreateObject("Wscript.Shell") 'FTP Upload to specified server sFtpsite = "$$$$$$$$$$$$" ' FTP Site sUserName = "$$$$$$$$$$$$" ' Location Specific User ID sPassword = "$$$$$$$$$$$$" ' Location Specific User Password sFromFolder = "$$$$$$$$$$$$" ' Folder where the file to be uploaded is located sFileName1 = "$$$$$$$$$$$$" ' File that is to be uploaded ' file to be created with instructions for ftp.exe sFtpInp = "e:\temp\test\instructions.ftp" ' Specified file to be created for FTP specific settings With CreateObject("Scripting.FileSystemObject") With .CreateTextfile(sFtpInp, True) .WriteLine "open " & sFtpsite .WriteLine "user " & sUsername .WriteLine sPassword .WriteLine "lcd " & sFromFolder .WriteLine "put " & sFilename1 .WriteLine "Close" .WriteLine "Quit" .Close End With oShell.Run "%windir%\system32\ftp.exe -i -n -s:" & sFtpInp, 1, True ' .DeleteFile sFtpInp End With ____________________________________________________________ Thank you in advance for any reponses - |
