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

Author Message
georgewolfe3
[View user's profile]
Donor
Joined: 2016-07-06
Posts: 1
Location: NYC
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>
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26331
Location: Prague, Czechia
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)
Advertisements

You can post new topics in this forum






Search Site

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!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License