[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Using rsh and ftp in VB

Posted on 2004-04-14
9
Medium Priority
?
1,188 Views
Last Modified: 2007-12-19
Hi:
My question has 2 parts.

A) How can I use the unix command "rsh" in my stand alone VBA to list out files in our unix box?  For example, the "rsh" I intend to use is:  "rsh  remote_host_name  -l  user_name  ls"

B) After the files are listed out, I want to use ftp or a ftp script to download the files into an Access table in my Local C:\ drive.  How can I do so?

Thanks
0
Comment
Question by:AugustineWan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 19

Accepted Solution

by:
BrianGEFF719 earned 1000 total points
ID: 10825607
you can do

dim remote_host,user_name,buffer
dim final

remote_host = "site.com"
user_name = "bill"
Shell "rsh " & remote_host & " -l " & user_name & " ls > out.txt"
open "out.txt" for input as #1
do while eof(1) = false
line input #1, buffer
final = final & buffer
loop
close #1

msgbox "return: " & vbcrlf & final

0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 10825617
now, as far as ftping, thats a completely different question.


You can either use the FTP cmd, by dynamically generating a command list then passing the command list to FTP. Or you can hard code the ftp (takes a lot of time).


-Brian
0
 

Author Comment

by:AugustineWan
ID: 10825786
Do I have to create out.txt first ? What is the purpose of "out.txt" and where should this file be located?

Thanks
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 10826232
Whatever the output from the RSH command is, it will be stored in out.txt


-Brian
0
 

Author Comment

by:AugustineWan
ID: 10826584
Thanks replying.

What is the purpose of having to open the "out.txt" file? ....

open "out.txt" for input as #1
do while eof(1) = false
line input #1, buffer
final = final & buffer
loop
close #1
0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 10826784
So your program can process the output from the RSH.

-brian
0
 

Author Comment

by:AugustineWan
ID: 10826892
I see.  For the FTP part, do you mind if you could further expand when you said:

You can either use the FTP cmd, by dynamically generating a command list then passing the command list to FTP?


Thanks

0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 10827134
Basically, what you can do with the FTP Command is this:

ftp -s:cmds.txt


where cmds.txt is a text file containing a list of commands for the FTP program.

cmds.txt
----------
open site.com
user username
pass password
get file.exe c:\file.exe
0
 

Author Comment

by:AugustineWan
ID: 10827434
Hi again.

I am writing the ftp commands into a text file "cmds.txt" and it contains:

open aixtest
user johndoe
pass 1234

But when I ran "ftp -s:cmds.txt", it does not recognize the password part.  It says:
"Password required for user johndoe."
"Login inccorrect"

Is there something wrong with the syntax?
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question