R.Wieser
2024-04-22 14:42:19 UTC
Hello all,
Using XPsp3.
A few days ago I tried to redirect some commandline output into a vbscript,
which than should be able to read it using "wscript.stdin.readline".
Examples:
echo hello | myvbscript
myvbscript < data.txt
Alas, all I got was an "invalid handle" error. :-(
The thing is, it works well enough when I explicitily specify wscript like
this
echo hello | wscript.exe myvbscript.vbs
wscript.exe myvbscript.vbs < data.txt
IOW, it likely has something to do with how the OS connects the .VBS
extension to the executable needing to run it, and than launches it.
Question:
Does anyone here know what to change in the registry to enable wscript to
recieve the piped / redirected output ?
Regards,
Rudy Wieser
ps:
I know that I can wrap the vbscript in a few lines of batch script and work
around the problem that way, but thats (work-arounds) not what I'm looking
for.
Using XPsp3.
A few days ago I tried to redirect some commandline output into a vbscript,
which than should be able to read it using "wscript.stdin.readline".
Examples:
echo hello | myvbscript
myvbscript < data.txt
Alas, all I got was an "invalid handle" error. :-(
The thing is, it works well enough when I explicitily specify wscript like
this
echo hello | wscript.exe myvbscript.vbs
wscript.exe myvbscript.vbs < data.txt
IOW, it likely has something to do with how the OS connects the .VBS
extension to the executable needing to run it, and than launches it.
Question:
Does anyone here know what to change in the registry to enable wscript to
recieve the piped / redirected output ?
Regards,
Rudy Wieser
ps:
I know that I can wrap the vbscript in a few lines of batch script and work
around the problem that way, but thats (work-arounds) not what I'm looking
for.