Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 09-25-2014, 01:57 PM
secureus secureus is offline
Registered User
 
Join Date: Sep 2014
Posts: 14
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
Reply With Quote
  #2  
Old 09-25-2014, 02:11 PM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
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
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
Reply

Tags
vbscript sfxcl


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 06:50 AM.