________________________________________
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eddie Willett
Sent: Thursday, September 22, 2005 12:14
To: perl-win32-admin@listserv.ActiveState.com
Subject: xcopy

I am writing a script that does and xcopy from a windows XP or 2000 machine to 
a windows NT 4 machine.  When I run the script it says that is can create the 
directory.  The directory that xcopy is having a hard time creating is a long 
name with a space in it for example "machine information".  The program 
basically dies when it tries to create this directory.  I am started using the 
dos xcopy command with the TEI switches so the line in perl was
System("xcopy $source $target /t /e /I");
When that was working I switched to File::Xcopy but that seems like it doesn't 
have some of the switches implemented yet.  I keep getting target directory 
could not be found even though I am telling it to create any missing 
directories.  
I believe this to be a NT 4 problem but I wanted to see if anyone else had run 
into this and found a solution.

Eddie



Eddie,

I've gotten interesting results when running Windows command line tools using 
the system command because of the way system treats the values passed as a list 
rather than a string. Eventually I found a way of formatting commands that 
works every time. Here's an example using xcopy.

my $xcopy = $ENV{'systemroot'} . '\\system32\\xcopy.exe';

my $source = 'c:\\foo';

my $target = 'c:\\bar';

my $command = qq{("$xcopy" "$source\\*.*" "$target" /E /H)};

system ($command);



If c:\bar doesn't exist and you're copying more than one file, xcopy will ask 
if the destination is a file or directory. To force xcopy to assume c:\bar is a 
directory use the /I switch.


keith

--

Keith R. Watson                        GTRI/ISD
Systems Support Specialist III         Georgia Tech Research Institute
[EMAIL PROTECTED]           Atlanta, GA  30332-0816
404-894-0836

_______________________________________________
Perl-Win32-Admin mailing list
Perl-Win32-Admin@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to