List Info

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




UNC copy to "Program Files" folder is problematic because of the "space".
country flaguser name
United States
2007-08-22 11:25:58

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

__._,_.___
.

__,_._,___
Re: UNC copy to "Program Files" folder is problematic because of the "space".
country flaguser name
United States
2007-08-22 12:04:52

>>&gt;>> "dachner2002&quot; == dachner2002 < dachner%40sbcglobal.net">dachnersbcglobal.net> 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%40stonehenge.com">merlynstonehenge.com> <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!

__._,_.___
.

__,_._,___
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )