Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Files are Not Getting Transfered by Shell Command

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.
Sachin Bankar

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:-
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

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
Else
            iresult = 1
            hprog = OpenProcess(GENERIC_ALL, False, dretval)
            WaitForSingleObject hprog, INFINITEEnd If
end if