home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.comp.os.windows-xp      Actually wasn't too bad for a M$-OS      17,273 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 17,092 of 17,273   
   JJ to R.Wieser   
   Re: vbscript CSCRIPT howto : writie to s   
   14 Dec 25 08:00:35   
   
   XPost: alt.comp.lang.vbscript, alt.windows7.general   
   From: jj4public@gmail.com   
      
   On Fri, 28 Nov 2025 19:05:57 +0100, R.Wieser wrote:   
   > Hello all,   
   >   
   > I know that I can use wscript.stdout.write(line) (or just wscript.echo) and   
   > wscript.stdin.read(line) for that.   
   >   
   > The problem is that I need it to happen even when the script has its   
   > standard input/output redirected (imagine a console-based "do you want to   
   > continue (YN)" interaction)   
   >   
   > Using Win32 I can just open "CONIN$" and "CONOUT$", but I can't get those to   
   > work using OpenTextFile / CreateTextFile.   
   >   
   > Any ideas ?   
   >   
   > Regards,   
   > Rudy Wieser   
      
   Console input : "CON"/"CONIN$" with mode 1 (read)   
   Console output: "CON"/"CONOUT$" with mode 2 (write)   
      
   e.g.:   
      
   set fs = createobject("scripting.filesystemobject")   
      
   'read from standard input. redirected or not   
   strstd = wsh.stdin.readline   
      
   'read from console input. from keyboard   
   set coninp = fs.opentextfile("con", 1)   
   strcon = coninp.readline   
      
   'write to standard output. redirected or not   
   wsh.stdout.writeline strstd   
      
   'write to console output. to console window   
   set conout = fs.opentextfile("con", 2)   
   conout.writeline strcon   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca