 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
LeeD
Joined: 17 May 2007 Posts: 311 Country: New Zealand |
|
Piping in JAL runandwait |
|
Hi
I can't seem to get piping command line output to a file working via runandwait in JAL windows edition 3.6.9?
This code does not produce a file
dim pid, number
RunAndWait( "ping localhost >> c:\\temp\\test.txt", "", 300, pid )
Trace shows
JAL 2: Executing RUNANDWAIT("ping localhost >> c:\temp\test.txt", "", "300", "
0")
Bad parameter >>.
JAL Return "2128"
Why can't I use a pipe?
Cheers
Lee
|
|
Wed Sep 22, 2010 11:22 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7952
|
|
|
|
Output redirection is a function of command shell. Without the shell > and >> are interpreted by the system as command line parameters not as redirection symbols. To make that work, please use cmd /C as in the following example:
 |
 |
dim pid, number
RunAndWait( "cmd /C ping localhost >> c:\\temp\\test.txt", "", 300, pid ) |
|
|
Wed Sep 22, 2010 11:34 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7952
|
|
|
|
By the way, built-in JAL statements Ping( ) and PingPort() can be used for the same purpose
|
|
Wed Sep 22, 2010 11:36 pm |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|