cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Keeping a curl comand result in a file, do not work from script

From: Doug McNutt <douglist_at_macnauchtan.com>
Date: Sun, 29 May 2011 14:34:56 -0600

At 21:45 +0200 5/29/11, Raul wrote:
I just find a workarround calling to a Bat file in which work curl fine.
 
Why did not work it in VBS?

2011/5/29 Raul <<mailto:raul.frutos_at_gmail.com>raul.frutos_at_gmail.com>

Hi,
 
I am working in a VBS script in which one of the task is to connect to a ftp server, get the list of the files and keep this info in an local ouput file.
 
It is very strange because it works from command line but it does not from my script.
 
This is the code:
 
Dim oShell
Dim returnResult
Set oShell = WScript.CreateObject ("WScript.Shell")
returnResult = oShell.run("curl -l <ftp://user:password@IP:21/test%20%3E%3Ed:%5Ctmp.txt,%201,True)>ftp://user:password@IP:21/test >>d:\tmp.txt, 1,True)
Set oShell = Nothing
msgbox returnResult

******

You might be better off using curl's -o Filepath option instead of a redirection. I'm pretty sure curl will create a file for you. Well, I know it will on a UNIX box, not so sure about a peecee.

-- 
--> A fair tax is one that you pay but I don't <--
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-05-29