Shell problem

Advertisement

pmkdatabase
Guest

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]

Reply with quote

Advertisement

pmkdatabase
Joined:
Posts:
2
Location:
Thailand

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.

Reply with quote

pmkdatabase
Joined:
Posts:
2
Location:
Thailand

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.

Reply with quote

martin
Site Admin
martin avatar

Re: Shell problem

pmkdatabase wrote:

hShell = Shell(GetDBPath & "winscp /script= " & sScriptFile)
There may not be a space after the /script=

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum