0

Can i somehow print texe in .vbs file to cmd console? I tried that:

Dim StdOut : Set StdOut = CreateObject("Scripting.FileSystemObject").GetStandardStream(1)
    
WScript.Echo "Hello"
WScript.StdOut.Write "Hello"
WScript.StdOut.WriteLine "Hello"
Stdout.WriteLine "Hello"
Stdout.Write "Hello"

It show an error when i run it with cmd also without.
see_an_error
Can somebody help me?
Thanks for answare.

user692942
  • 16,398
  • 7
  • 76
  • 175
Filip
  • 3
  • 1
  • [The StdIn, StdOut, and StdErr streams can be accessed while using CScript.exe only. Attempting to access these streams while using WScript.exe produces an error.](https://www.vbsedit.com/html/cb7c65bf-2dce-40ab-b769-3fd59941f74b.asp) – Flakes Apr 14 '21 at 11:12
  • https://stackoverflow.com/questions/4388879/vbscript-output-to-console – Moir Apr 14 '21 at 12:52
  • 2
    Does this answer your question? [vbscript output to console](https://stackoverflow.com/questions/4388879/vbscript-output-to-console) – Moir Apr 14 '21 at 12:59
  • Helo @Moir. No when i tried "Wscript.Echo "Like this?"" it show only pop up message but i wanna to write it to the console. – Filip Apr 17 '21 at 10:46
  • @Filip I believe you read the question rather then the answers. – Moir Apr 17 '21 at 12:24
  • @Moir i tried and it work but it can only write to cscript.exe. I want write to console. – Filip Apr 18 '21 at 17:43

0 Answers0