vbscript output to console

前端 未结 6 768
春和景丽
春和景丽 2020-12-07 11:16

What is the command or the quickest way to output results to console using vbscript?

6条回答
  •  余生分开走
    2020-12-07 11:45

    This was found on Dragon-IT Scripts and Code Repository.

    You can do this with the following and stay away from the cscript/wscript differences and allows you to get the same console output that a batch file would have. This can help if your calling VBS from a batch file and need to make it look seamless.

    Set fso = CreateObject ("Scripting.FileSystemObject")
    Set stdout = fso.GetStandardStream (1)
    Set stderr = fso.GetStandardStream (2)
    stdout.WriteLine "This will go to standard output."
    stderr.WriteLine "This will go to error output."
    

提交回复
热议问题