WinExec 函数执行Cmd命令

    技术2026-10-02  6

    WinExec('cmd.exe netstat -an',SW_SHOW);   //不执行;

    WinExec('cmd.exe /c netstat -an',SW_SHOW);   //执行,但一闪而过;

    WinExec('cmd.exe /k netstat -an',SW_SHOW);   //成功;

     

    开始菜单 运行 输入 cmd /? 查看/c,/k帮助。 Ctrl+C 结束运行。

    WinExec('cmd.exe /k del "C:/Documents and Settings/Administrator/Cookies/*.txt" ',SW_HIDE); //路径有空格要加双引号;

    最新回复(0)