
Accessing data passed by using "pipe"
It doesn't appear to grab anything being piped in.
For example, here's a script that you can use as an alternative answer
to the other question you asked; it will return the command lines for
all processes currently running, including itself.
I saved it as cmlines.vbs, then executed it with the command line
echo y | cscript cmlines.vbs arg1 arg2 arg3
The output it returned for the Commandline of its own process was
cscript cmlines.vbs arg1 arg2 arg3
On Error Resume Next
Dim Wmi, Wql, Process, Processes
Set Wmi = getobject("winmgmts:")
Wql = "select * from Win32_Process"
Set Processes = Wmi.ExecQuery(Wql)
If Processes.Count <> 0 Then
For Each Process In Processes
WScript.Echo Process.CommandLine
Next
End If
--
Please respond in the newsgroup so everyone may benefit.
http://dev.remotenetworktechnology.com
Quote:
> Hello,
> How do I access data that has been passed to a script using the "pipe"
> operator
> for e.x:
> echo "y" | test.vbs
> Regards,
> Rohit