transfer text file from Unix to Windows shared drive

Posted on 2008-11-06
Last Modified: 2013-12-26
Can any one help me in writing script to transfer textfile from unix box to windows shared drive?

I don't have Samba, Only method I can you is ftp or Perl Script.
Can you help me in writing Perl script or ftp scritp.
Windows servername =USA1234DR
Unix Servername = UXDVE12

My file is in
$home/usr> ls

I want to copy to my windows shared drive \\USA1234DR\workingdir

Question by:rajsan1
    LVL 1

    Accepted Solution

    Can you use SSH ?

    The use this software here:

    Normaly you can use SSH on unix.
    LVL 39

    Expert Comment


    use Net::FTP;
    $ftp = Net::FTP->new("", Debug => 0)
      or die "Cannot connect: $@";
      or die "Cannot login ", $ftp->message;
      or die "Cannot change working directory ", $ftp->message;
      or die "get failed ", $ftp->message;

    Open in new window


    Author Comment

    I am getting error when I compile this code
    Can't locate Net/ in @INC (@INC contains: /opt/per15/lib/5.00502/PA-RISC1.1
    Can you help me..

    OR Is it possible in ftp script
    LVL 40

    Expert Comment

    LVL 39

    Expert Comment

    From a prompt as root:
        cpan Net::FTP
        perl -MCPAN -e 'install Net::FTP'
    LVL 61

    Expert Comment

    You need SAMBA installed on UNIX client machine. Then you can use smbclient to transfer file to windows share.
    Alternatives are NFS server included with MS-SFU, or using least common denominator - FTP

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
    A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (,  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

    761 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

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now