Copy files from Windows Server to Unix Server [VB-6]

Hi,

I've a DLL which runs in Win2000 Server and generated some documents in a folder.
I want to copy the entire folder to a location on my unix server.
Is there any way to copy files from Windows-2000 Server to a Unix Server.


I'd a same setup working for an excel report.
The flow is like ->
Java file on (unix)  - calls - Perl file(on unix) - which calls an ASP file(on win2000) -
which in turn calls the VB DLL and generates a report - this 1 documnet is passed on to Perl file -
which uses webcopy exe and saves this document on a specified location on the unix server.

But now, with the same DLL, 'm creating 11 docs. So there in no 1 doc which can be returned from ASP to Perl.
Hence, i need a way that when all the docs are prepared (just moving out of VB program) .. copy
all the docs from this win2000 server to Unix.
Also, Unix Server has different logins present, so how can i convey in my program(if possible) ..
so as to which login to use.

Can anyone suggest a way out for the same.
Any help is greatly appreciated.

Regards,
aashish_bgAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

fridomCEO/ProgrammerCommented:
There are a lot of ways to achive the goald. You can try you luck with
curl: http://curl.haxx.se
you can use rsync http://samba.anu.edu.au/rsync/
you can to it from within you program with some wrapper around libcurl

Or you can use some Perl script for the copy.

You do not tell us what you'd prefer. So this is just educated guessing ;-)

Friedrich

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
terabiteauCommented:
Get Samba (http://samba.anu.edu.au) installed on the UNIX server and then mount a drive for your windows system to scribble on.

Then both systems can see the files and manipulate them natively.

Cheers, Frank.
aashish_bgAuthor Commented:
Thanx for the reply,

I would prefer to copy the files from my VB-Code to the Unix Server(which is running on SunOS). The the VB DLL is invoked from ASP (which inturn is invoked by my Java Application whenever a user wants to create reports for a particular Order).
The highlevel flow is like - Java - Perl - ASP - VB DLL

The docs are created on Win2000 Server under a directory (named as Order #).
It would be easy for me, if possible, that just before comin out of the VB Program, i copy the full directory to the Unix Server.

I went to the curl site and d/l the stuff for VB. (still goin thru the documentation).
It would be really helpful if u can provide a some sample code which i need to append in the VB Code so as to copy the entire directory to unix server.

I also went to a site "http://www.java400.de/en/default.html?../Javactpe.htm"
to generate the word docs from Java. If this works i don't need to goto my Win2000 Server ]
and i'ould be able to generate the letters using a Servlet at my Unix Server itself.

Waiting for a reply.
Regards,
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

fridomCEO/ProgrammerCommented:
I'm not using the VisualBasic interface, and I'm not willing to install it implement the stuff for free. The idea is very easy.
Walk the directory
call the transfer function on any file.

Friedrich
Beer7ChildCommented:
Hi,

You can use the utility 'rcp' to copy files from a Windows box to a Unix box.
All you will need is for your VB  code to execute that utility withe proper paramaters.

rcp is usually installed together with Windows - e.g. c:\WINDOWS\SYSTEM32\RCP.EXE
Its usage is straightforward, and if you just type
   rcp
in a command shell, you will see the details of its command line options.

Here is an example for your particular case :
  1. Source folder is the folder c:\tmp\docs from the Windows box
  2. Destination folder /tmp/docs_from_pc on the Unix box
  3. Unix machine name is 'eeunix'
  4. Unix user name 'eeuser'

 The required command is :

   rcp -r -b c:\tmp\docs eeunix.eeuser:/tmp/docs_from_pc

The -r option means you are copying a complete folder
the -b is needed when you copy binary (i.e. not ASCII) files.

The related VB code is :

   Dim RetVal
   RetVal = Shell("rcp -r -b c:\tmp\docs eeunix.eeuser:/tmp/docs_from_pc", 1)

Note that the user account on the target unix machine must not have a password.
If this is not possible due to security settings, and you wish to pusruit the rcp approach,
you will need to configure the Unix machine to have teh same user account
on both Unix & PC machine. In that case, you may find this usefull:

  http://support.microsoft.com/default.aspx?scid=kb;EN-US;324061&sd=tech


Hope this helps,
b7c.
terabiteauCommented:
I'd recommend if you are interested in "copying" files you give rcp a miss ... it is far too insecure!

Instead look to using scp (from the ssh suite) ... then all the traffic will be encrypted and you can also secure the authentication process as well.  To get it working unattended use a private/public key auth process and setup the *nix environment to only allow scp inbound commands to the designated location on its file system.  That way if the key gets pinched by some malcontent all they can do is submit poisoned data - which hopefully your application code can detect and or reject.

Cheers, Frank.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.