Loading ...
Sorry, an error occurred while loading the content.

UNC copy to "Program Files" folder is problematic because of the "space".

Expand Messages
  • dachner2002
    The space in Program Files is giving me trouble. I m trying to use UNC to copy a file from one server to another. This works: system( copy temp abc.txt
    Message 1 of 3 , Aug 22 9:25 AM
    • 0 Attachment
      The "space" in "Program Files" is giving me trouble. I'm trying to use
      UNC to copy a file from one server to another.

      This works:
      system("copy \\temp\\abc.txt \\\\99.99.99.99\\c\$\\temp\\abc.txt");


      This doesn't.
      system("copy \\temp\\abc.txt \\\\99.99.99.99\\c\$\\Program
      Files\\abc.txt");


      I've tried all kinds of hex and octal solutions:

      system("copy \\temp\\abc.txt \\\\99.99.99.99\\c\$\\Program\\040
      Files\\abc.txt");


      99.99.99.99 represents my IP address.

      Thanks,
      Don
    • merlyn@stonehenge.com
      ... dachner2002 The space in Program Files is giving me trouble. I m trying to use dachner2002 UNC to copy a file from one server to another. Don t use
      Message 2 of 3 , Aug 22 10:04 AM
      • 0 Attachment
        >>>>> "dachner2002" == dachner2002 <dachner@...> writes:

        dachner2002> The "space" in "Program Files" is giving me trouble. I'm trying to use
        dachner2002> UNC to copy a file from one server to another.

        Don't use system() if you don't need it:

        use File::Copy;
        copy $src, $dest;


        --
        Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
        <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
        Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
        See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
      • dachner2002
        Perfect!! Thanks a million!! Don ... I m trying to use ... 777 0095 ... training!
        Message 3 of 3 , Aug 22 10:30 AM
        • 0 Attachment
          Perfect!!

          Thanks a million!!

          Don


          --- In perl-beginner@yahoogroups.com, merlyn@... wrote:
          >
          > >>>>> "dachner2002" == dachner2002 <dachner@...> writes:
          >
          > dachner2002> The "space" in "Program Files" is giving me trouble.
          I'm trying to use
          > dachner2002> UNC to copy a file from one server to another.
          >
          > Don't use system() if you don't need it:
          >
          > use File::Copy;
          > copy $src, $dest;
          >
          >
          > --
          > Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503
          777 0095
          > <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
          > Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
          > See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
          training!
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.