VanDyke Software Forums

VanDyke Software Forums (https://forums.vandyke.com/index.php)
-   Scripting (https://forums.vandyke.com/forumdisplay.php?f=14)
-   -   VB Script to invoke SFXCL.exe (https://forums.vandyke.com/showthread.php?t=11711)

secureus 09-25-2014 01:57 PM

VB Script to invoke SFXCL.exe
 
I am trying the samples of SFXCL Automation Tips. I happened to see the VB Script name : MinimalSFXCLUploadExample.vbs. Is it possible to share the VB Script file. I am trying to call sfxcl.exe from VB Script

rtb 09-25-2014 02:11 PM

Hi secureus,

Sure. Here is the code example:
Code:

' MinimalSFXCLUploadExample.vbs

' Generate a unique log file name
For Each item In GetObject("winmgmts:\\.\root\cimv2").ExecQuery("Select * from Win32_OperatingSystem")
    strLocalDateTime = item.LocalDateTime
Next
strLogFile = "C:\Temp\SFXCL_LOG__" & Left(strLocalDateTime, 18) & ".txt"

' Launch SFXCL - Upload all .CSV files from local "Out" folder to remote "In" folder:
nResult = CreateObject("WScript.Shell").Run(_
    "SFXCL /NOPROMPT /RETRYCOUNT 0 /LOG """ & strLogFile & """ C:\Out\*.CSV  sftp://user:pass@192.168.232.149/In", _
    0, _
    True)

' Check for failure
If nResult <> 0 Then
    WScript.Echo "Transfer Failure.  See " & strLogFile & " for details."
Else
    WScript.Echo "Transfer Success."
End If



All times are GMT -6. The time now is 12:26 AM.