Topic "Files are Not Getting Transfered by Shell Command"

Author Message
Sachin Bankar


Hi All,

We are using WinSCP 4.3.4 . When we run below command from command shell it runs fine

Command IS as Below:-
C:\Program Files\WinSCP\winscp /command "option transfer ascii" "option batch off" "option confirm off" "open s" "get /NCBOUT/DBMX0914.002.500 I:\NCBReverse\" "get /NCBOUT/CSOX0914.002.500 I:\NCBReverse\" "get /NCBOUT/CFOX0914.002.501 I:\NCBReverse\"  "cd /NCBOUT/" "rm DBMX0914.002.500" "rm CSOX0914.002.500" "rm CFOX0914.002.501

But when same is tried through VB6.0 code it does not move files from SFTP location. From Some days before our SFTP application was working fine but from couple of weeks it is not transferring any files. I have attached screen shot of our code snippet. Can you please guide us on this.

Below is snippet of Our Code(VB 6.0)

 dretval = 0
 sCommand = "C:\Program Files\WinSCP\winscp /command ""option transfer ascii"" ""option batch off"" ""option confirm off"" ""open sftp://" & Username & ":" & Password & "@" & IpAddress & """ ""get " & sSFtpOutArea & objFileList1.Item(1) & " " & LocalPath & """ ""get " & sSFtpOutArea & objFileList1.Item(2) & " " & LocalPath & """ ""get " & sSFtpOutArea & objFileList1.Item(3) & " " & LocalPath & """  ""cd " & sSFtpOutArea & """ ""rm " & objFileList1.Item(1) & """ ""rm " & objFileList1.Item(2) & """ ""rm " & objFileList1.Item(3) & ""
dretval = Shell(sCommand)

If dretval = 0 Then
  WriteToSFTPLog ("Shell Command didn't work in Case4 " & Format(Date, "DD/MM/YYYY"))
            iresult = 0
            iresult = 1
            hprog = OpenProcess(GENERIC_ALL, False, dretval)
            WaitForSingleObject hprog, INFINITEEnd If
end if
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
Please attach a full log file showing the problem (using the latest version of WinSCP).

To generate log file, use /log=path_to_log_file command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you may email it to me. You will find my address (if you log in) in my forum profile. Please include link back to this topic in your email. Also note in this topic that you have emailed the log.

You can post new topics in this forum


What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License