我有一些需要运行的命令行实用程序的vbs文件。 但在某些情况下,这些使用情况可能会提示用户继续输入。我希望能够捕捉这些条件,提供“是”的答案,然后继续。如何通过vbs执行命令
这是我到目前为止有:
Dim oExec
set oExec = objShell.Exec("mycmd pw ....")
do while not oExec.StdOut.AtEndofStream
wscript.echo "status of script: " & oExec.Status
input = input & oExec.StdOut.ReadLine()
if instr(input, "create key? (y/n)") <> 0 Then exit do
loop
oExec.Stdin.Write "y"
当我做到这一点,没有任何反应。我看到我插入的调试语句...但脚本似乎挂起。
任何帮助,将不胜感激。