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: script file work with bat file, but hangs when started with vba shell

Your command is wrong. Try in on command-line. It won't work either.

You are missing a /C switch after the cmd.exe:

retval = Shell("cmd.exe /C C:\Users\George\Dropbox\SNETWORK\WINSCP\datascope_get.bat", 1)
georgewolfe3

script file work with bat file, but hangs when started with vba shell

SCRIPT:
open ftp://password:username@hosted.datascope.reuters.com/reports/
option confirm off
get 20170104_AGIGL_CLOSE.csv
Close

BATCH file:
winscp.com /script="datascope_get.txt" /xmllog="datascope_get.log"

VBA CALL:
Dim retval
retval = Shell("cmd.exe C:\Users\George\Dropbox\SNETWORK\WINSCP\datascope_get.bat", 1)

None of versions of the above code solve the problem. The above opens a command window showing the following:
Microsoft Windows [Version 10.0.14393]
(c) ms ...

C:\Users\George\Dropbox\SNETWORK\WINSCP>