向大家请教,在delphi中如何运行ms-dos批处理文件?我试着用winexec,类似可执行文件,不行哎。

解决方案 »

  1.   

    用shellexecute试试。加入头文件shellapi
      

  2.   

    winexec是可以的,bat文件里面用绝对路径
      

  3.   

    用sheelexecute
    BAT里用绝对路径
      

  4.   

    maming2003,请写详细点儿好吗?最好举个例子,谢谢!
      

  5.   

    USES 
       WinExec('d:\a.bat',1);
      ShellExecute(0,'open','a.bat','参数','d:\',1);
      ShellExecute(0,'','a.bat','参数','d:\',1);
      ShellExecute(0,'','d:\a.bat','参数','',1);
      

  6.   

    USES SHELLAPI;
       WinExec('d:\a.bat',1);
      ShellExecute(0,'open','a.bat','参数','d:\',1);
      ShellExecute(0,'','a.bat','参数','d:\',1);
      ShellExecute(0,'','d:\a.bat','参数','',1);