Danna Li wrote:
>
> Hello,
>
> I am trying to make system call to xcopy in perl on Windows XP to copy
> down a folder from the server locally. Same and similar commands works
> on other perl script but not on the current one I am working on.
> All of the following $cmd work from a command prompt but seems to be
> ignored from the system call in the perl script and it has a return
> value of 0.
> Any help or suggestion would be much appreciated!
> Thanks,
> D
>
> # the paths have no blank space
> $localbuilddir = $LayoutDrive."\\builds\\".$buildname;
> $binbuild =
> $builds."\\".$tempdata[0]."\\".$tempdata[1]."\\Release\\".$tempdata[2]."\\".$buildname;
>
> # only the copy command copying one file with filename spelled out works
> $cmd = "copy ". $binbuild . "_\\abc.exe_ <file://abc.exe/>
> ".$localbuilddir; $sysretval = system ($cmd);
>
> #$cmd = "xcopy ". $binbuild . "_\\*.*_ <file://*.*/> ".$localbuilddir .
> "\\ /Y /S /I " ;
> #$cmd = "copy ". $binbuild . "_\\*.dll_ <file://*.dll/> " . $localbuilddir;
> #$cmd = "xcopy ". $binbuild . "_\\*.*_ <file://*.*/> ".$localbuilddir .
> "\\ /Y /S /I " ;
> #$cmd = $ENV{'SYSTEMROOT'}."\\SYSTEM32\\xcopy /V /E /I /F /Y " .
> $binbuild . "_\\*.*_ <file://*.*/> " . $localbuilddir;
> #$cmd = "$ENV{COMSPEC} /C xcopy /V /E /I /F /Y " . $binbuild . "_\\*.*_
> <file://*.*/> " . $localbuilddir;
>
Try printing out your variables to avoid quoting problems especially
where you need to use backslashs.
John
_______________________________________________
Perl-Win32-Admin mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs