Files are Not Getting Transfered by Shell Command
Hi All,
We are using WinSCP 4.3.4 . When we run below command from command shell it runs fine
Command IS as Below:-
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)
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 sftp://ftpuser:xxx@1234@172.17.xxx.xx" "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
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 Else iresult = 1 hprog = OpenProcess(GENERIC_ALL, False, dretval) WaitForSingleObject hprog, INFINITEEnd If end if