VBscript code to capture stdout, without showing console window

前端 未结 7 633
生来不讨喜
生来不讨喜 2020-11-28 11:48

This is a VBScript code example that shows how to catch whatever a command line program sends to standard output. It executes the command xcopy /? and shows the

7条回答
  •  心在旅途
    2020-11-28 12:53

    Instead of WScript.Shell, consider using using Win32_Process with startupInfo.ShowWindow = 0 to launch the process with SW_HIDE. I posted a detailed example under VBS Run cmd.exe output to a variable; not text file.

提交回复
热议问题