【发布时间】:2016-10-23 19:11:58
【问题描述】:
我正在尝试从 vbscript 中执行批处理命令。
我希望将输出写入文件。
当我运行它时,我没有得到控制台或文件的输出。
我正在尝试:
Dim objShell, command
Set objShell = WScript.CreateObject ("WScript.shell")
command = "wmic product get Name > textfile.txt"
objShell.Run command, 0, True
Set objShell = Nothing
我做错了什么?
当我在命令提示符下运行wmic 命令时,它运行良好。
【问题讨论】:
标签: batch-file vbscript wmic