Page 1 of 1 1
Topic Options
#108670 - 2003-11-21 08:56 PM WshPipe barfs
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Chris, any idea why WshPipe() would bark when one adds the "/s" switch in:

$ShellCMD = "dir c:\data /b /a:d /s"

It works up until the "/s" is added.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#108671 - 2003-11-21 09:16 PM Re: WshPipe barfs
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
My Howard, you do have a colorful way with words (re: barf). Reminds me of Les pulling information through one's nose. Does it happen on ALL directories you do this on or just that one directory you have ? (maybe your "size" is choking WSH ? (hehee) )
Top
#108672 - 2003-11-21 09:22 PM Re: WshPipe barfs
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
you could alos look and EnumDir()... it uses WSHPipe
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#108673 - 2003-11-21 09:38 PM Re: WshPipe barfs
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Shawn my "size" is not choking WshPipe It appears to hang as soon recursing into a subdirectory is required.

_________________________
Home page: http://www.kixhelp.com/hb/

Top
#108674 - 2003-11-21 09:46 PM Re: WshPipe barfs
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Does this help?

Code:

Function WshPipe($ShellCMD, OPTIONAL $NoEcho)
Dim $oExec, $Output
$oExec = CreateObject("WScript.Shell").Exec($ShellCMD)
If Not VarType($oExec)=9 $WshPipe="WScript.Shell Exec Unsupported" Exit 10 EndIf
;While Not $oExec.Status Loop
$Output = $oExec.StdOut.ReadAll + $oExec.StdErr.ReadAll
If Not $NoEcho $Output Endif
$WshPipe=Split($Output,@CRLF) ;CHR(10))
Exit($oExec.ExitCode)
EndFunction


Top
#108675 - 2003-11-21 10:22 PM Re: WshPipe barfs
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Yeah that does. I will have to read a little...
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#108676 - 2003-11-22 12:24 AM Re: WshPipe barfs
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
I've seen it on another app that I tried to wshPipe, namely the RPC vunerability apps from Microsoft. Seems that the $oExec.Status is set to 1 for some reason.

From my testing the "While Not $oExec.Status Loop" is superfluous anyway. It is meant to not allow the function to continue until the shell command has finished. The Exec() method is like KiX's Shell command in that the script does not proceed until the command has finished.

I'll update the function in the UDF forum.

Top
#108677 - 2003-11-22 12:27 AM Re: WshPipe barfs
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Well, I'll update it when the edit timeout thingy gets fixed.
Top
Page 1 of 1 1


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

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

Generated in 0.059 seconds in which 0.028 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