Post a reply

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

pmkdatabase wrote:

hShell = Shell(GetDBPath & "winscp /script= " & sScriptFile)

There may not be a space after the /script=
pmkdatabase

Re: Shell problem

The problem is passing a dynamic name for the script file:
this works: ' hShell = Shell(GetDBPath & "winscp /script=C:\Users\peterk\Documents\IPOP\ftp_orders.txt")

However, when I build it in VBA, like this:
sScriptFile = GetDBPath & "ftp_orders.txt"
Debug.Print sScriptFile
(debug prints "C:\Users\peterk\Documents\IPOP\ftp_orders.txt)
hShell = Shell(GetDBPath & "winscp /script= " & sScriptFile)

Then it doesn't work.
Same thing for these:
hShell = Shell(GetDBPath & "winscp /script= .\ftp_orders.txt")
hShell = Shell(GetDBPath & "winscp /script= ftp_orders.txt")

Thank you.
pmkdatabase

Re: Shell problem

martin wrote:

Please, enable the log file by /log=path_to_log and post the log file.


I am making some progress with this problem. I think it might be something to do with paths. I'll post back if I hit another dead end.

Thank you for taking the time to reply.
martin

Re: Shell problem

Please, enable the log file by /log=path_to_log and post the log file.
pmkdatabase

Shell problem

I've spent many hours on this before asking for assistance. I am trying to shell from vba (MS Access). This was working before, and I am not sure what broke.

This works: shell("c:\ftp\winscp")
This does not (and there is no log file):
shell("c:\ftp\winscp /script=ftp_test.txt")

I can open the saved session "ftporders" from the console.

ftp_test.txt
============
open ftporders

Thank you!

this is the INI file entry for the session:
[Sessions\ftporders]
HostName=193.151.18.10
PortNumber=21
UserName=adam [snip]
FSProtocol=5
Password=A35C7A561384A4 [snip]