command line in vbscript

Core FTP client questions and answers
Locked
AronEi
Posts: 8
Joined: Thu Feb 09, 2012 9:46 pm

command line in vbscript

Post by AronEi »

Hi all,
i'm using core-ftp, and i'm really enjoying it.
but i ran into a problem, i wright a vb-script to download a ftp file
and here is a sample of my script:

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.run ("""C:\Program Files\CoreFTP\coreftp.exe""" & " -d ftp://username:password@some-host.com -p C:\MyScripts\temp", 0, true)

when i run this line of code, everything is good.
but when i add the -s switch for silent mode, like this line:
WshShell.run ("""C:\Program Files\CoreFTP\coreftp.exe""" & " -d ftp://username:password@somehost.com -p C:\MyScripts\temp -s", 0, true)
than i got no error but the file does not download.
i checked the exit code for this script, and it shows as exit code: 30
any help on what's going on?

thanks in advanced.
ForumAdmin
Site Admin
Posts: 1011
Joined: Mon Mar 24, 2003 4:37 am

Post by ForumAdmin »

try:

"C:\Program Files\CoreFTP\corecmd.exe" -s ftp://username:password@somehost.com/ -d /path/file -p C:\MyScripts\temp\
AronEi
Posts: 8
Joined: Thu Feb 09, 2012 9:46 pm

Post by AronEi »

Hi ForumAdmin,
Thank you for your help.
i tried your suggestion, but unfortunately it didn't help me, i still got the same result.

i realized one thing, that this problem is only for one of my ftp host's, i have another host which works fine even with coreftp.exe.
so do you have any clue what i could be? any more help?
AronEi
ForumAdmin
Site Admin
Posts: 1011
Joined: Mon Mar 24, 2003 4:37 am

Post by ForumAdmin »

add: -log c:\existing_directory\yourlog.txt and then post it here
AronEi
Posts: 8
Joined: Thu Feb 09, 2012 9:46 pm

Post by AronEi »

Thank you for your reply.
her is the result from the log file (ip address changed)

02/12/12 15:04

Resolving ftp.somehost.com...

Connect socket #556 to 4.2.2.2, port 21...220 Microsoft FTP Service

USER 123456789

331 Password required for 123456789.

PASS **********

230 User 123456789 logged in.

SYST

215 Windows_NT

CWD /

250 CWD command successful.

PASV

227 Entering Passive Mode (4,2,2,2,12,214).

LIST

Connect socket #572 to 4.2.2.2, port 3286...125 Data connection already open; Transfer starting.

226 Transfer complete.

PWD

257 "/" is current directory.

CWD /

250 CWD command successful.

PASV

227 Entering Passive Mode (4,2,2,2,12,215).

LIST

Connect socket #572 to 4.2.2.2, port 3287...125 Data connection already open; Transfer starting.

226 Transfer complete.

PASV

227 Entering Passive Mode (4,2,2,2,12,216).

LIST


Connect socket #576 to 64.9.53.79, port 3288...125 Data connection already open; Transfer starting.

226 Transfer complete.

TYPE I

200 Type set to I.

PASV

227 Entering Passive Mode (64,9,53,79,12,217).

RETR CATLIST

Connect socket #576 to 64.9.53.79, port 3289...CATLIST - File not found...

550 CATLIST: Access is denied.

QUIT

221

sent 42, recd 42

Total uploaded files: 0

Total uploaded data: 0

Total downloaded files: 0

Total downloaded data: 0


catlist is the file name (it doesn't have an extention)
ForumAdmin
Site Admin
Posts: 1011
Joined: Mon Mar 24, 2003 4:37 am

Post by ForumAdmin »

550 CATLIST: Access is denied.

Either you don't have permission or it's a directory.

Use -d /path/CATHLIST/ for downloading a directory.
AronEi
Posts: 8
Joined: Thu Feb 09, 2012 9:46 pm

Post by AronEi »

It is a file with no extension not a directory, and i do have permission as i proved it when i removed the -s switch and it work excellent, so the problem is something else i still try to figure out.
ForumAdmin
Site Admin
Posts: 1011
Joined: Mon Mar 24, 2003 4:37 am

Post by ForumAdmin »

When you are logged in from the GUI, double check the directory that you are in, in the "Selected Directories / URL" dropdown. That will be the path you use in the -d parameter.
Locked