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
VanguardLH,
In your first example, you specify "myvbscript" instead of
"myvbscript.vbs".
Yes, and that was on purpose.
Can't have a filetype association (to a handler aka
script interpreter) without an extension on the filename.
the myvbscript "filename" as in my first example should have a .vbs
extension just like in my second example ? My 'puter seems to disagree
with you. Its able to, in the first example, start the provided vbscript just fine.
However, I'm not sure filetype association works in piped/redirected
stdout, but you could try it.
Ehhh... Whut ?
You're suggesting to me to try what I posted as the problem of this thread ? Really ?
I suspect you must execute a program first to provide piping or
redirection (to have stdin and stdout available by the program's
process).
Hmmm ... AFAIKS that would create a different problem : the 'program thats executed first' could abort due to not finding any input on its stdin, or lose output because its stdout isn't connected yet.
By the time the program (filetype handler) runs, assuming it does,
you've already attempted piping or stdout before the program has
loaded.
:-) That is what a (win32) pipe is for : you write stuff to it, and as long as nobody is reading on the other end it just gets buffered.
echo hello | myvbscript.vbs
myvbscript.vbs < data.txt
But, that was something I hadn't tried yet (as providing the extension should, in this case, not make any difference). A quick test just now shows that it doesn't change anything (no workie).
In your first example, you specify "myvbscript" instead of
"myvbscript.vbs".
Can't have a filetype association (to a handler aka
script interpreter) without an extension on the filename.
However, I'm not sure filetype association works in piped/redirected
stdout, but you could try it.
I suspect you must execute a program first to provide piping or
redirection (to have stdin and stdout available by the program's
process).
By the time the program (filetype handler) runs, assuming it does,
you've already attempted piping or stdout before the program has
loaded.
echo hello | myvbscript.vbs
myvbscript.vbs < data.txt
For your first example, you said "all I got was an invalid handle"
error. Your first example errored when you posted, but now it works?
VanguardLH,
For your first example, you said "all I got was an invalid handle"
error. Your first example errored when you posted, but now it works?
If you *throw the context in which both where said away* than you are right.
Not so much if you keep it in context though.
But I have no wish to /again/ try to fight you to make you understand what /should/ have been obvious.
Goodby kid.
Regards,
Rudy Wieser
Ah, yes, your moving target to your respondents. Troll ploy.
VanguardLH,
Ah, yes, your moving target to your respondents. Troll ploy.
Ah yes, the "if I don't get it its your fault" troll ploy.
I think there is *no* way you can tell me the subject/context of either
post. And a hint : it isn't the script.
On 4/23/2024 12:32 PM, Kerr-Mudd, John wrote:
Are you looking for help or a fight? Just asking, I offer neither.
That's just Rudy's style. When he says, "Screw you, little boy,
you're less than a fly", he means, "I'm not so sure you're right
on that point."
Rudy enjoy's arguing, so he comes up with unsolvable puzzles
and then criticizes the answers. He'll ask things like, "I opened a
program and it instantly closed, yet the other shortcut works fine.
But where did my baloney sandwich go?" Then people make the
mistake of trying to help him sort out faulty shortcuts because,
well, who doesn't love a puzzle? :)
Are you looking for help or a fight? Just asking, I offer neither.
Are you looking for help or a fight?
Just asking,
I offer neither.
That's just Rudy's style. When he says, "Screw you, little boy,
you're less than a fly", he means, "I'm not so sure you're right
on that point."
Rudy enjoy's arguing, so he comes up with unsolvable puzzles
and then criticizes the answers.
Then people make the mistake of trying to help him sort out faulty
shortcuts because, well, who doesn't love a puzzle? :)
In this case, he wants files themselves to do reads and writes of other files. He wants data objects aka files to be programs themselves, so
files can read and write, and can do anything else he wants. He has
watched too many Marvel and Harry Potter movies. Logic interferes with
his obstreperous temperament.
Newyana2,[...]
Rudy enjoy's arguing, so he comes up with unsolvable puzzles
and then criticizes the answers.
"unsolvable puzzles" ? You know that for a fact ? In that case I can stop trying to find a solution to it and put it to rest. You /do/ have something to back that up ofcourse.
If you think Newyana2 needs to "back up" his "unsolvable puzzles"
statement, you may want to enroll in Logic 101.
I've noted you tend to emit this logical fallacy when you get
too worked up (which is a quite common occurence). There's a
lesson in there.
[Disclaimer: I don't know the first thing about VBScript, but have a
brain and am not afraid to use it.]
VanguardLH <[email protected]> wrote:
[...]
In this case, he wants files themselves to do reads and writes of other files. He wants data objects aka files to be programs themselves, so
files can read and write, and can do anything else he wants. He has watched too many Marvel and Harry Potter movies. Logic interferes with
his obstreperous temperament.
FTR, AFAICT he does *not* "want files themselves to do reads and
writes of other files". (I think) That's your misunderstanding. The
'files' are not "data objects", but a VBScript (myvbscript[.vbs]), i.e.
it *is* a program. That's clear by the fact that the .vbs file *is*
executed.
I don't know how a .vbs file gets executed, but I assume it works like
.exe and .bat files that the command interpreter (cmd.exe) sees that myvbscript is actually myvbscript.vbs and hence calls wscript.exe to
execute myvbscript.vbs.
Rudy's problem is that he can't imagine that someone interprets his
posts in any other way than he does. If there's another interpretation,
it's the other guy's fault and things go downhill from there.
'.exe' & '.bat' files (again, normally) get sent to the command
interpreter
He does seem to want to specify his 'problem' very tightly but then not accept any workaround suggested.
It's pointless trying to help ISTM.
Frank,
If you think Newyana2 needs to "back up" his "unsolvable puzzles" statement, you may want to enroll in Logic 101.
:-) I did not expect him to prove it. I'm not /that/ daft.
But I think I may expect him to be able to explain /why/ he thinks its unsolvable. Otherwise his classification isn't worth the ink its written with.
And pardon me, I've more than once encountered people who use similar claims just because they either could not grasp the problem, or didn't actually
want to try to solve it. You know, <whining>Its too *hard*</whining>.
I've noted you tend to emit this logical fallacy when you get
too worked up (which is a quite common occurence). There's a
lesson in there.
I disagree. See above.
But, if you can quote something specific we could always discuss it. For some odd reason I've got very little problem with being proven wrong.
On 24 Apr 2024 12:46:12 GMT
Frank Slootweg <[email protected]d> wrote:
[Disclaimer: I don't know the first thing about VBScript, but have a
brain and am not afraid to use it.]
VanguardLH <[email protected]> wrote:
[...]
In this case, he wants files themselves to do reads and writes of other files. He wants data objects aka files to be programs themselves, so files can read and write, and can do anything else he wants. He has watched too many Marvel and Harry Potter movies. Logic interferes with his obstreperous temperament.
FTR, AFAICT he does *not* "want files themselves to do reads and
writes of other files". (I think) That's your misunderstanding. The
'files' are not "data objects", but a VBScript (myvbscript[.vbs]), i.e.
it *is* a program. That's clear by the fact that the .vbs file *is* executed.
I don't know how a .vbs file gets executed, but I assume it works like .exe and .bat files that the command interpreter (cmd.exe) sees that myvbscript is actually myvbscript.vbs and hence calls wscript.exe to execute myvbscript.vbs.
You'd be wrong there; 'anyfile.vbs' (or any other 'thing' gets dealt with
by Windows 'associations'); anything ending with '.vbs' would
normally be associated with 'wscript.exe'
'.exe' & '.bat' files (again, normally) get sent to the command interpreter and are then either executed (if EXE by loading and finding the start
point) or seen as BATCH and interpreted by the command (or should I say
CMD) parser.
Rudy's problem is that he can't imagine that someone interprets his
posts in any other way than he does. If there's another interpretation, it's the other guy's fault and things go downhill from there.
He does seem to want to specify his 'problem' very tightly but then not accept any workaround suggested. It's pointless trying to help ISTM.
FTR, AFAICT he does *not* "want files themselves to do reads and
writes of other files". (I think) That's your misunderstanding. The
'files' are not "data objects", but a VBScript (myvbscript[.vbs]), i.e.
it *is* a program. That's clear by the fact that the .vbs file *is*
executed.
I don't know how a .vbs file gets executed, but I assume it works like
.exe and .bat files that the command interpreter (cmd.exe) sees that myvbscript is actually myvbscript.vbs and hence calls wscript.exe to
execute myvbscript.vbs.
My guess was/is that the 'command interpreter' (Rudy doesn't say
how he invokes his commands)
<whoosh!>
I think somebody complained about people not reading what was
written, but going off on a tangent.
Sorry, same logical fallacy.
I vaguely remember mentioning it's always the other guy's fault.
Another locigal fallacy.
Frank Slootweg <[email protected]d> wrote:
FTR, AFAICT he does *not* "want files themselves to do reads and
writes of other files". (I think) That's your misunderstanding. The
'files' are not "data objects", but a VBScript (myvbscript[.vbs]), i.e.
it *is* a program. That's clear by the fact that the .vbs file *is* executed.
He wants to pipe or redirect files into files, like:
textfile1 | textfile2
textfile2 < textfile1
He discovered the solution was to specify the .vbs extension on the
filename to get that handler to read the text file to run the script.
Frank,
My guess was/is that the 'command interpreter' (Rudy doesn't say
how he invokes his commands)
I didn't ?
[quote first post]
I tried to redirect some commandline output into a vbscript
[/quote]
Besides that, the "echo hello | ..." and "... < data.txt" should have been dead give-aways.
He wants to pipe or redirect files into files, like:
textfile1 | textfile2
textfile2 < textfile1
It's not about filetype association, etc., but about what translates <filename> to <filename>.vbs *before* filetype association takes places,
He discovered the solution was to specify the .vbs extension on the
filename to get that handler to read the text file to run the script.
Nope, he 'discovered' no such thing. He specified the .vbs extension
*and* he added wscript.exe to interpret the .vbs file.
My guess was/is that the 'command interpreter' (Rudy doesn't say
how he invokes his commands)
I didn't ?
[quote first post]
I tried to redirect some commandline output into a vbscript
[/quote]
Besides that, the "echo hello | ..." and "... < data.txt" should have
been
dead give-aways.
As you didn't specifically say you invoked from cmd.exe, I said
'command interpreter', i.e. the general term. That's all.
just confirms what others and I have been saying about your style
of communication ("Rudy's problem is that he can't imagine that
someone interprets his posts in any other way than he does.").
Frank,
My guess was/is that the 'command interpreter' (Rudy doesn't say
how he invokes his commands)
I didn't ?
[quote first post]
I tried to redirect some commandline output into a vbscript
[/quote]
Besides that, the "echo hello | ..." and "... < data.txt" should have
been dead give-aways.
As you didn't specifically say you invoked from cmd.exe, I said
'command interpreter', i.e. the general term. That's all.
(I quoted everything. Otherwise you will just complain I snipped important stuff)
Really ?
You said : "Rudy doesn't say how he invokes his commands".
And I responded with quoting from my first post. So yes, I did say it. There was nothing to guess at.
Frank,
It's not about filetype association, etc., but about what translates <filename> to <filename>.vbs *before* filetype association takes places,
Only for you and John. For me its absolutily irrelevant.
If you think its causing the stated problem than just add the ".vbs" extension to the two lines in my first example see if it changes anything.
Newsflash : It doesn't.
My guess was/is that the 'command interpreter' (Rudy doesn't say
how he invokes his commands)
I didn't ?
[quote first post]
I tried to redirect some commandline output into a vbscript
[/quote]
Besides that, the "echo hello | ..." and "... < data.txt" should have
been dead give-aways.
As you didn't specifically say you invoked from cmd.exe, I said
'command interpreter', i.e. the general term. That's all.
(I quoted everything. Otherwise you will just complain I snipped
important
stuff)
Really ?
You said : "Rudy doesn't say how he invokes his commands".
And I responded with quoting from my first post. So yes, I did say it.
There was nothing to guess at.
Sigh!
Not that, despite your aggressive, confrontational, insulting
communication style, you still deserve a response, but saying
"commandline" is not unambiguous.
That why I said what I said. Like I said "... That's all.". Time to
get over it.
It's not about filetype association, etc., but about what
translates <filename> to <filename>.vbs *before* filetype
association takes places,
Only for you and John. For me its absolutily irrelevant.
Incorrect interpretation. It was (and is) never a problem for *me*
either, but as John and VanguardLH brought it up, I addressed it.
Moral: It's not your thread. Posters are free to respond to
anything any poster said.
If you think its causing the stated problem than just add the ".vbs"
extension to the two lines in my first example see if it changes
anything.
Newsflash : It doesn't.
Newsflash: *I* never said or implied it did.
...Nope, he 'discovered' no such thing. He specified the .vbs extension
*and* he added wscript.exe to interpret the .vbs file.
But "no" to the "he added wscript.exe to interpret the .vbs file" part.[followed by an explanation to why not]
I only called you on the logical fallacy of your demand to Newyana2
to "back up" his "unsolvable puzzles" statement.
All other responses were triggered by *your* responses to my responses
to *others* (VanguardLH and John).
As implied by my 'Disclaimer:', I never addressed the problem you
described in your OP.
(So any complaints on that are misplaced.)
(Also) Enroll in Usenet 101 and Reading for Comprehension 101.
"Goodbye Rudy."
Frank,
I only called you on the logical fallacy of your demand to Newyana2
to "back up" his "unsolvable puzzles" statement.
And I called bullshit on that "logical fallacy" of yours - and explained
why. I have not seen you respond to that. Another example of your "if I ignore it hard enough it never happened" methodology.
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 144:35:45 |
| Calls: | 12,089 |
| Calls today: | 2 |
| Files: | 15,000 |
| Messages: | 6,517,491 |