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


Joined: 09 Aug 2002 Posts: 117 Location: Lewes, U.K.
|
Posted: Wed Nov 02, 2011 4:04 pm Post subject: Pipe parameter |
|
|
Hi All
Does anyone know how the pipe parameter works with the run command. Mine has worked fine, but is now locking up and I have to crash out to release vds.
This used to work fine but for some reason now locks up
| Code: |
runz cmd.exe" /c netstat -ano",pipe
|
When I add the wait parameter the command runs until the timeout then quits and returns an incomplete
output form the console
| Code: |
runz cmd.exe" /c netstat -ano",pipe,wait 20
|
Is there some sort of buffer involved?
Thanks
David... |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Wed Nov 02, 2011 5:42 pm Post subject: |
|
|
Heya David,
It's been a long time, but I don't recall using Quote marks in command line work like that unless I wanted to preserve long file names. Maybe try that line without the quotes and see if it makes any difference. _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Thu Nov 03, 2011 2:12 am Post subject: |
|
|
It does seem like a buffer issue.
PIPE works with all the netstat switches except "a"
Not sure if this will help you but, I wrote a little script a while back that places the output of a command-line in a list for viewing and testing. It just pipes the output to a temporary text file and then loads it into a list before deleting the text file. Just thought it might provide an alternative for ya.
| Code: | #--------------------------------------------------------#
# COMMANDLINEPIPE.DSC #
# MICHAEL R. ANDERSEN #
# MARCH 15, 2005 #
#--------------------------------------------------------#
Title CmdLinePipe Reader
DIALOG CREATE,CmdLinePipe Reader,-1,0,681,530
DIALOG ADD,BUTTON,Run,499,531,64,24,Run,,default
DIALOG ADD,BUTTON,Close,499,612,64,24,Close
DIALOG ADD,LIST,LIST1,6,5,672,484
DIALOG ADD,EDIT,cmdline,502,98,417,19,<cmdline>
DIALOG ADD,TEXT,CommandLine,507,8,,,CommandLine:
%x = @sendmsg(@winexists(~LIST1),$0194,1000,0)
DIALOG SHOW
List create,1
:Evloop
wait event
goto @event()
:RunBUTTON
List clear,1
List clear,List1
Runh cmd /c @chr(34)@dlgtext(cmdline)@chr(34) >@path(%0)cmdline.txt,wait
List loadfile,1,@path(%0)cmdline.txt
file delete,@path(%0)cmdline.txt
List assign,List1,1
goto evloop
:CloseBUTTON
:Close
exit |
|
|
| Back to top |
|
 |
dmonckton Contributor


Joined: 09 Aug 2002 Posts: 117 Location: Lewes, U.K.
|
Posted: Fri Nov 04, 2011 9:08 am Post subject: |
|
|
Thanks Aslan
I used your method, here is a generic version of it..
| Code: |
list create,xx
runh cmd.exe" /c netstat -ano > %temp%\zulu.tmp",wait 30
list loadfile,xx,@env(temp)\zulu.tmp
file delete,@env(temp)\zulu.tmp
rem ----- optional commands ---------
list [assign|append],yy,xx
list close,xx
|
David.M |
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Sun Nov 06, 2011 1:22 am Post subject: |
|
|
I don't think you need WAIT with RUN cmd /c.
I believe the script will halt until the RUN command finishes.
I've used RUN with Active Directory commands that take a while and the script seems to halt until the command is completed.
I think WAIT is only needed if the RUN command opens a dialog that requires user input.
However, I'm sure that using the WAIT option won't hurt either
Glad I could help. |
|
| Back to top |
|
 |
|
|
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 You can attach files in this forum You can download files in this forum
|
|