>>>>> "SHC" == Shawn H Corey <shawnhco...@gmail.com> writes:
SHC> axr0284 wrote: >> Hi, >> I was wondering if anybody can tell me what I am doing wrong. I am >> trying to use xcopy: >> system("XCOPY", "KCPSM3.EXE", $s_tempLocation, "/R /Y"); >> >> $s_tempLocation contains "c:\temp" >> >> When I run the script, I get the following error message: >> Invalid number of parameters >> >> The following command in the command prompt works fine: >> xcopy KCPSM3.EXE c:\temp /R /Y >> >> Thanks for any insight. >> Amish >> >> SHC> I haven't used Windows in years but try separating the flags. SHC> system("XCOPY", "KCPSM3.EXE", $s_tempLocation, "/R", "/Y"); it helps to explain why that should work. if you pass a list of values to system or exec, it will bypass the shell or perl splitting the string on spaces. that means the last arg would have been '/R /Y/' which is not a valid option in winblows. by splitting it up into two option values, that should fix it. another solution would have been to call system with one string and then perl (or the shell if shell metachars are found) would split that on white space and usually do the right thing. this is all documented in perldoc -f system so the OP should read that and learn more about how to correctly use system. uri -- Uri Guttman ------ u...@stemsystems.com -------- http://www.sysarch.com -- ----- Perl Code Review , Architecture, Development, Training, Support ------ --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com --------- -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/