Thanks to everyone who has replied to this thread. Hi BrowserUK, I have used the method what you have suggested.It worked for smaller f +iles. But when the file size started increasing, the perl script star +ted hanging. In the below code snippet the shyam.txt and shyam1.txt files are of sm +aller size and it gets copied.But when the zip file is being copied, +the script hangs. The zip file is of size around 40-60MB.In the below example out of 4 f +iles only first 3 files are copied that is shyam.txt,shyam1.txt,Logs2 +011-09-19_2321.zip and the 4th zip file is not copied but script got +completed. Can you suggest if something needs to be corrected? If this works then + I need to try copying large log files of size in GBs. Also I would like to know if any perl packages are required to be inst +alled in order to achieve this. thanks in advance
my $remote_system_ip = "10.10.2.2"; my $user_name = "Administrator"; my $password = "d*diablo123"; my $source_dir = "C:\\shyam\\dir1"; my $target_file1 = "\\\\$remote_system_ip\\c\$\\shyam_IC\\shyam.txt"; my $target_file2 = "\\\\$remote_system_ip\\c\$\\shyam_IC\\shyam1.txt"; my $target_file3 = "\\\\$remote_system_ip\\c\$\\shyam_IC\\Logs2011-09- +19_2321.zip"; my $target_file4 = "\\\\$remote_system_ip\\c\$\\shyam_IC\\Logs2011-09- +19_215.zip"; `net use \\\\$remote_system_ip\\c\$ $password \/user:$user_name`; `copy \/Y $target_file1 $source_dir`; print("1"); `copy \/Y $target_file2 $source_dir`; print("2"); `copy \/Y $target_file3 $source_dir`; print("3"); `copy \/Y $target_file4 $source_dir`; print("4"); `net use \\\\$remote_system_ip\\c\$ \/delete`;

In reply to Re^2: file copy from windows system by rkshyam
in thread file copy from windows system by rkshyam

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.