Re: piping / redirecting into a vbs script ?
VanguardLH <[email protected]>
| Newsgroups | alt.comp.os.windows-xp,alt.windows7.general |
|---|---|
| Organization | Usenet Elder |
| Message-ID | <[email protected]> |
Frank Slootweg <[email protected]> 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. VBScript is an interpreted language, not a compiled one. .vbs are text files. That they contain scripts is only useful when they are read by an interpreter. .vbs files are not executable. They are read by an interpreter that does the code execution. You can compile .vbs files, like after porting to VB or VB.NET and then *compiling* the script) into .exe files, but then they are .exe files, not .vbs text files describing a script. 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. > 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. Batch (.bat) files are just text files, too. They are not executable. They must get interpreted by cmd.exe. Likewise, the filetype association on .bat has the text file read into command shell to do the interpretation of the script. Personally I wouldn't rely on filetype association hoping the handler gets loaded at the right time to load the text file to run the script and generate the stdin, stdout, and stderr streams.