zoukankan      html  css  js  c++  java
  • vbs调用exec执行dos命令之诡异细节

    情况一 没有“cmd /c ”开头去执行dos命令(dos命令带有管道操作符和其他命令),单独一个dos命令有没有cmd开头貌似都没啥异常

    Set oExec=WshShell.exec(" netstat -ano|findstr 843")

    Set oStdOut = oExec.StdOut
    strLine = oStdOut.ReadLine

    此时strline 为空。也就是oStOut里面没有接受到东西。

    情况二 加上“cmd /c ”

    Set oExec=WshShell.exec("cmd /c netstat -ano|findstr 843")

    Set oStdOut = oExec.StdOut
    strLine = oStdOut.ReadLine

    此时strLine 就有内容了。

  • 相关阅读:
    python-04
    python-03
    python-02
    python-01
    day4-RHCS
    python 之元组(tuple)
    11.21
    python之猜数小游戏
    python之简陋的数据库
    11.20
  • 原文地址:https://www.cnblogs.com/gyzhouyong/p/4548957.html
Copyright © 2011-2022 走看看