Page 1 of 1 1
Topic Options
#115 - 1999-06-15 12:34 AM Problem with Shell command (XCopy)?!?
Anonymous
Unregistered


I am attempting to used the command:

shell "xcopy c:\data " + $drv + $uname + "\data /e /i /h > " + $drv + $uname + "\copied.log"

but am getting the error "Invalid number of parameters.". However, when I replace 'shell' with '?' so that I can see what the output is, it looks great and works great when ran on the commandline.

Any ideas? Is there a limit of chars that the 'shell' command can issue?

../mk

Top
#116 - 1999-06-15 02:12 AM Re: Problem with Shell command (XCopy)?!?
Anonymous
Unregistered


Try :

$command = "xcopy c:\data " + $drv + $uname + "\data /e /i /h > " + $drv + $uname + "\copied.log"

shell "$command"

------------------
Lon Geefshuysen
Lon_Geefshuysen@essentium.com



Top
#117 - 1999-06-15 07:35 AM Re: Problem with Shell command (XCopy)?!?
Anonymous
Unregistered


Lon,

That did not work either. I'm now trying a different angle on this (redirectouput), but the output is still going to the screen. I'm using the following:

$command = "xcopy c:\data " + $drv + $uname + "\data /e /i /h"
$null = redirectoutput($drv + $uname + "\copied.log")
shell "$command"
redirectoutput("")

The log file is being created, but it is empty. The big list of files being copied are still dumped to the screen.

Am I doing something wrong? I hope that it is possible to create log files.

../mk

Top
#118 - 2002-02-19 11:49 PM Re: Problem with Shell command (XCopy)?!?
Anonymous
Unregistered


Ever figure this one out? I have a similar issue using
Shell "c:\temp\tlist mstask >c:\temp\plist.txt"

Works fine if I run ir from a Dos prompt but refuses to do the redirect when using the Shell command

Top
#119 - 2002-02-19 11:56 PM Re: Problem with Shell command (XCopy)?!?
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
that`s because you need to say this:

Shell "%comspec% /c c:\temp\tlist mstask >c:\temp\plist.txt"

-Shawn

Top
#120 - 2002-02-20 12:09 AM Re: Problem with Shell command (XCopy)?!?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Perhaps a short exxplanation is in order. DOS commands like '|' pipe and '>' redirect require the command interpreter. When you run it from a DOS prompt, you have the interpreter loaded. When you shell to a command, you need load the interpreter hence the %comspec%.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#121 - 2002-02-23 04:39 PM Re: Problem with Shell command (XCopy)?!?
Anonymous
Unregistered


Thanks LLigetfa

That helps

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1046 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.09 seconds in which 0.059 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org