| View previous topic :: View next topic |
| Author |
Message |
dmonckton Contributor


Joined: 09 Aug 2002 Posts: 117 Location: Lewes, U.K.
|
Posted: Tue Nov 04, 2008 5:54 pm Post subject: Piping standard output |
|
|
Hi
Can anyone tell me why this does not work?
list create,1
run cmd /c xcopy @chr(34)c:\documents and settings\dmonckt\my documents\my pictures\*.*@chr(34) h:\atest /s,WAIT,PIPE
%p = @pipe()
list assign,1,%p
The XCOPY works fine but not the piping part?
Thanks
David.M |
|
| Back to top |
|
 |
JerryDee Contributor


Joined: 19 Oct 2005 Posts: 53 Location: Czech Republic
|
Posted: Tue Nov 04, 2008 8:37 pm Post subject: |
|
|
Hi David,
I think the xcopy command doesn't produce any "standard output", so that the value for the PIPE parameter is unrecognized. _________________ Jerry
(VDS 4,5,6 Pro | V-Setup 3) |
|
| Back to top |
|
 |
dmonckton Contributor


Joined: 09 Aug 2002 Posts: 117 Location: Lewes, U.K.
|
Posted: Wed Nov 05, 2008 8:49 am Post subject: |
|
|
I thought what you see in the console screen is the standard output! If it is then there is loads of it scrolling up the screen. I might have to experiment with the XCOPY switches to see what happens.
Thanks
David.M |
|
| Back to top |
|
 |
JerryDee Contributor


Joined: 19 Oct 2005 Posts: 53 Location: Czech Republic
|
Posted: Wed Nov 05, 2008 1:05 pm Post subject: |
|
|
Hi David,
you can try this:
...
run cmd /c xcopy @chr(34)c:\documents and settings\dmonckt\my documents\my pictures\*.*@chr(34) h:\atest /s,WAIT 10,PIPE
... _________________ Jerry
(VDS 4,5,6 Pro | V-Setup 3) |
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Wed Nov 05, 2008 5:30 pm Post subject: |
|
|
Hi dmonckton
Don't use WAIT with PIPE. The PIPE option will halt your script until the command is finished.
Try this:
| Code: | run cmd /c xcopy @chr(34)"c:\documents and settings\dmonckt\my documents\my pictures\"*.*@chr(34)h:\atest /s,PIPE
%%Return = @pipe()
Info %%Return
exit |
|
|
| Back to top |
|
 |
JerryDee Contributor


Joined: 19 Oct 2005 Posts: 53 Location: Czech Republic
|
Posted: Wed Nov 05, 2008 5:42 pm Post subject: |
|
|
That is why I advised to add (e.g.) "10" like a parameter for the WAIT _________________ Jerry
(VDS 4,5,6 Pro | V-Setup 3) |
|
| Back to top |
|
 |
dmonckton Contributor


Joined: 09 Aug 2002 Posts: 117 Location: Lewes, U.K.
|
Posted: Fri Nov 07, 2008 11:27 am Post subject: |
|
|
Ok Jerry you were right XCOPY does not produce any output if you
run it from the commandline. If you run it from the console it does!
Thanks
David... |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Fri Nov 07, 2008 3:13 pm Post subject: |
|
|
Why are you using xcopy anyway? The VDS File command can copy files. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
dmonckton Contributor


Joined: 09 Aug 2002 Posts: 117 Location: Lewes, U.K.
|
Posted: Tue Nov 11, 2008 9:44 am Post subject: |
|
|
The reason for using XCOPY is.....
When I copy the source I want the original path copied aswell. VDS file copy fails if the target path does not exist already where as XCOPY creates the target path on the fly.
Thanks
David.M |
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Sun Nov 16, 2008 2:30 am Post subject: |
|
|
| You can always have VDS create the target path before initiating the copy process. |
|
| Back to top |
|
 |
|