Home All Groups Group Topic Archive Search About
Author
23 Mar 2006 6:05 PM
Rick
Is there a Shell command where I can connect to an ftp site
write a user and password, change directory and download a file?
All in a single line?

In the DOS window I can do tihs:

>FTP
>open myurl
system prompts: User? >MyName
system prompts: Password? >MyPassword
>CD MyFolder
>GET MyFile MyLocalAddress
>quit

and I can download a file FROM DOS...

Is there a way to do this in a sigle line, so I use SHELL in vb6?



Thank you.
--
Rick

Author
23 Mar 2006 6:14 PM
Robert Ellis
Rick,

Why not put what you've got into a .BAT (batch) file, and then (in a
single-line) Shell to the batch file?
You may have to use the full synatax, e.g. "cmd32.exe filename.bat" (or
whatever it is).
Not the prettiest solution but it'd work, I believe.

HTH,
Robert



Show quoteHide quote
"Rick" <R***@discussions.microsoft.com> wrote in message
news:6B08A7D5-6C3F-41DE-BF37-4E57202FF69E@microsoft.com...
> Is there a Shell command where I can connect to an ftp site
> write a user and password, change directory and download a file?
> All in a single line?
>
> In the DOS window I can do tihs:
>
>>FTP
>>open myurl
> system prompts: User? >MyName
> system prompts: Password? >MyPassword
>>CD MyFolder
>>GET MyFile MyLocalAddress
>>quit
>
> and I can download a file FROM DOS...
>
> Is there a way to do this in a sigle line, so I use SHELL in vb6?
>
>
>
> Thank you.
> --
> Rick
Author
23 Mar 2006 6:15 PM
Veign
Why are you hung up on a single line?

--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--


Show quoteHide quote
"Rick" <R***@discussions.microsoft.com> wrote in message
news:6B08A7D5-6C3F-41DE-BF37-4E57202FF69E@microsoft.com...
> Is there a Shell command where I can connect to an ftp site
> write a user and password, change directory and download a file?
> All in a single line?
>
> In the DOS window I can do tihs:
>
>>FTP
>>open myurl
> system prompts: User? >MyName
> system prompts: Password? >MyPassword
>>CD MyFolder
>>GET MyFile MyLocalAddress
>>quit
>
> and I can download a file FROM DOS...
>
> Is there a way to do this in a sigle line, so I use SHELL in vb6?
>
>
>
> Thank you.
> --
> Rick
Author
23 Mar 2006 6:33 PM
DRBarkley
Well, his name is Rick.  ;-)


Show quoteHide quote
"Veign" <NOSPAMinveign@veign.com> wrote in message
news:%23Fx4WZqTGHA.4520@TK2MSFTNGP10.phx.gbl...
> Why are you hung up on a single line?
>
> --
> Chris Hanscom - Microsoft MVP (VB)
> Veign's Resource Center
> http://www.veign.com/vrc_main.asp
> Veign's Blog
> http://www.veign.com/blog
> --
>
>
> "Rick" <R***@discussions.microsoft.com> wrote in message
> news:6B08A7D5-6C3F-41DE-BF37-4E57202FF69E@microsoft.com...
> > Is there a Shell command where I can connect to an ftp site
> > write a user and password, change directory and download a file?
> > All in a single line?
> >
> > In the DOS window I can do tihs:
> >
> >>FTP
> >>open myurl
> > system prompts: User? >MyName
> > system prompts: Password? >MyPassword
> >>CD MyFolder
> >>GET MyFile MyLocalAddress
> >>quit
> >
> > and I can download a file FROM DOS...
> >
> > Is there a way to do this in a sigle line, so I use SHELL in vb6?
> >
> >
> >
> > Thank you.
> > --
> > Rick
>
>
Author
23 Mar 2006 6:36 PM
Rick Rothstein
>> Why are you hung up on a single line?
>>
> Well, his name is Rick.  ;-)

LOL

(The REAL) Rick
Author
23 Mar 2006 6:51 PM
Rick
Thanks folks.
Answers:

1. I'm the real Rick.
2. The first problem is that under D.O.S. there is a dialogue, i.e.
interaction
     between the user and the machine. So a batch file won't work.
3. The second problem is that certain machines can't download files, or at
least they
    come corrupted, when I use ftpOCX, Internet Transfer controls or Inet.dll.
    The reason:
    They don't have permisssions to use FTP, they have to use http.
    All of the above work well on the mayority of the machines.

    I'm thinig of using http instead of FTP. But the only way I could
download the   
    files was by the command line ftp, as I explained above.

4. Everthing boils down to hiding the user name and password of the site
   from the software  user. I can't use the Webbrowser control because it
leaves
   a "history" of files    behind. How can I avoid this "history"?


Now, je, je, I can hang up...:)



--
Rick


Show quoteHide quote
"Rick Rothstein" wrote:

> >> Why are you hung up on a single line?
> >>
> > Well, his name is Rick.  ;-)
>
> LOL
>
> (The REAL) Rick
>
>
>
Author
23 Mar 2006 7:08 PM
Rick Rothstein
>> >> Why are you hung up on a single line?
>> >>
>> > Well, his name is Rick.  ;-)
>>
>> LOL
>>
>> (The REAL) Rick
>>
> 1. I'm the real Rick.

Maybe I should have signed myself as

     The real ONE-LINER Rick"

I'm the Rick that DRBarkley is referring to due to my penchant for posting
one-liner solutions to questions that get asked here in the VB newsgroups.
Here is a link that you may find interesting on this...

http://groups.google.com/groups?as_q=rothstein&num=100&scoring=r&hl=en&as_epq=&as_oq=one-liner+oneliner&as_eq=&as_ugroup=&as_usubject=&as_uauthors=&lr=&as_drrb=q&as_qdr=&as_mind=1&as_minm=1&as_miny=1981&as_maxd=23&as_maxm=3&as_maxy=2006&safe=off

Rick
Author
23 Mar 2006 7:12 PM
Jeff Johnson [MVP: VB]
"Rick" <R***@discussions.microsoft.com> wrote in message
news:D90BB38F-3114-47B7-8965-5703777D1B53@microsoft.com...

> 1. I'm the real Rick.

"The best thing about the Internet is that nobody knows you're really a
dog."

> 2. The first problem is that under D.O.S. there is a dialogue, i.e.
> interaction
>     between the user and the machine. So a batch file won't work.

I know some implementations of FTP can take a file as input and basically
automate an entire FTP session. Might be worth looking into.

But I really recommend you go to http://vbnet.mvps.org and grab one of
Randy's FTP samples. Quite simple.
Author
30 Mar 2006 5:17 PM
Karl E. Peterson
Rick wrote:
> 3. The second problem is that certain machines can't download files,
> or at least they
>     come corrupted, when I use ftpOCX, Internet Transfer controls or
>     Inet.dll. The reason:
>     They don't have permisssions to use FTP, they have to use http.
>     All of the above work well on the mayority of the machines.
>
>     I'm thinig of using http instead of FTP. But the only way I could
> download the
>     files was by the command line ftp, as I explained above.

This doesn't make any sense.  Some machines are prohibited from creating FTP
connections, but you can use use FTP.EXE to do so anyway?  If FTP.EXE can
make a connection, so can you -- via either wininet.dll or wsock32.dll.
Perhaps you could be more clear about this seeming contradiction?

> 4. Everthing boils down to hiding the user name and password of the
>    site from the software  user. I can't use the Webbrowser control
> because it
> leaves
>    a "history" of files    behind. How can I avoid this "history"?

I'm sure there's a way to clear the cache, but that's just going way
overboard.

You could also, potentially, open a pipe to the command line, and feed it
standard input I suppose.  I've never tried it going in that direction, but
I have read the stdout.  This page might get you thinking:

http://www.vb-helper.com/howto_capture_console_stdout.html

Later...   Karl
--
Working without a .NET?
http://classicvb.org/
Author
23 Mar 2006 8:04 PM
Dick Grier
I was Rick for a while (years ago) until I thought I should be Rich.  No one
was willing to pay, so... Now I'm Dick.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004.
See www.hardandsoftware.net for details and contact information.
Author
23 Mar 2006 6:45 PM
Veign
LOL.

--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--


Show quoteHide quote
"DRBarkley" <David.NOSPAMBarkley@L-3NOSPAMCom.com> wrote in message
news:uHtB9gqTGHA.4900@TK2MSFTNGP12.phx.gbl...
> Well, his name is Rick.  ;-)
>
>
> "Veign" <NOSPAMinveign@veign.com> wrote in message
> news:%23Fx4WZqTGHA.4520@TK2MSFTNGP10.phx.gbl...
>> Why are you hung up on a single line?
>>
>> --
>> Chris Hanscom - Microsoft MVP (VB)
>> Veign's Resource Center
>> http://www.veign.com/vrc_main.asp
>> Veign's Blog
>> http://www.veign.com/blog
>> --
>>
>>
>> "Rick" <R***@discussions.microsoft.com> wrote in message
>> news:6B08A7D5-6C3F-41DE-BF37-4E57202FF69E@microsoft.com...
>> > Is there a Shell command where I can connect to an ftp site
>> > write a user and password, change directory and download a file?
>> > All in a single line?
>> >
>> > In the DOS window I can do tihs:
>> >
>> >>FTP
>> >>open myurl
>> > system prompts: User? >MyName
>> > system prompts: Password? >MyPassword
>> >>CD MyFolder
>> >>GET MyFile MyLocalAddress
>> >>quit
>> >
>> > and I can download a file FROM DOS...
>> >
>> > Is there a way to do this in a sigle line, so I use SHELL in vb6?
>> >
>> >
>> >
>> > Thank you.
>> > --
>> > Rick
>>
>>
>
>
Author
23 Mar 2006 8:32 PM
Bob Butler
"DRBarkley" <David.NOSPAMBarkley@L-3NOSPAMCom.com> wrote in message
news:uHtB9gqTGHA.4900@TK2MSFTNGP12.phx.gbl
> Well, his name is Rick.  ;-)
>
>
> "Veign" <NOSPAMinveign@veign.com> wrote in message
> news:%23Fx4WZqTGHA.4520@TK2MSFTNGP10.phx.gbl...
>> Why are you hung up on a single line?

ROTFLMAO

--
Reply to the group so all can participate
VB.Net: "Fool me once..."
Author
27 Mar 2006 12:48 PM
Tony Spratt
Show quote Hide quote
"Rick" <R***@discussions.microsoft.com> wrote in message
news:6B08A7D5-6C3F-41DE-BF37-4E57202FF69E@microsoft.com...
> Is there a Shell command where I can connect to an ftp site
> write a user and password, change directory and download a file?
> All in a single line?
>
> In the DOS window I can do tihs:
>
> >FTP
> >open myurl
> system prompts: User? >MyName
> system prompts: Password? >MyPassword
> >CD MyFolder
> >GET MyFile MyLocalAddress
> >quit
>
> and I can download a file FROM DOS...
>
> Is there a way to do this in a sigle line, so I use SHELL in vb6?
>
>
>
> Thank you.
> --
> Rick

You can use a scripted FTP session as follows:

Dim dblProcessId as Double

dblProcessId = Shell("ftp -s:c:\ftpscript.txt myurl", vbHide)

And in the script file put the commands in the order you want them to be
input, e.g.

MyName
MyPassword
CD MyFolder
GET MyFile MyLocalAddress
Bye

That should do what you need.

Cheers,

Tony.
Author
30 Mar 2006 12:26 PM
Alfie [UK]
On Mon, 27 Mar 2006 13:48:26 +0100, "Tony Spratt"
<tony_spr***@hotmail.com> wrote:
Show quoteHide quote
>You can use a scripted FTP session as follows:
>
>Dim dblProcessId as Double
>
>dblProcessId = Shell("ftp -s:c:\ftpscript.txt myurl", vbHide)
>
>And in the script file put the commands in the order you want them to be
>input, e.g.
>
>MyName
>MyPassword
>CD MyFolder
>GET MyFile MyLocalAddress
>Bye
>
>That should do what you need.
>
I mentioned this in an earlier reply, but the OP had stated earlier he
did not want the user to see the authentication details such as password
which via this method are in plain text in the 'script' file.
--
Alfie
<http://www.delphia.co.uk/>
99 percent of lawyers give the rest a bad name.