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

Advertisement

georgewolfe3
Donor
Joined:
Posts:
1
Location:
NYC

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>

Reply with quote E-mail

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

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)

Reply with quote

Advertisement

You can post new topics in this forum