winexec('cmd /c mode com1 9600,n,8,1');
为什么在2000下好用到98下就不行了呢
把cmd改成command也不行呢~~~说白了我就是想让DEPHI在98下调用Mode命令
大家看看有什么好办法呢

解决方案 »

  1.   

    98下好像直接Winexec('mode /参数');就可以了吧.好久没用98了.
      

  2.   

    运行了,不好使,说找不到文件
    commandLine := 'mode com1 9600,n,8,1';
    dd := WinExec(PChar(commandLine),SW_HIDE);  case dd of
         0: showmessage('The system is out of memory or resources');
         ERROR_BAD_FORMAT: showmessage('The .exe file is invalid (non-Win32 .exe or error in .exe image).');
         ERROR_FILE_NOT_FOUND: showmessage('The specified file was not found.');
         ERROR_PATH_NOT_FOUND: showmessage('The specified path was not found.');
      end;
      

  3.   

    你加上路径试试.比如Winexec('c:\windows\mode /参数');
      

  4.   

    winexec(pchar('cmd /c mdoe COM1 9600,N,8,1'),sw_hide);
      

  5.   

    winexec(pchar('cmd.COM /c mdoe COM1 9600,N,8,1'),sw_hide);winexec(pchar('COMMAND.COM /c mdoe COM1 9600,N,8,1'),sw_hide);
      

  6.   

    TO : dickeybird888(于伟刚) ( ) 
    你的方法是在2000下运行的,我说的是在98下怎样运行呢~
    2000下已经通过了,但在98下调用mode命令就不好使呢~~~
    加路径已经加了,但还是不好使直接跳到这里
    ERROR_PATH_NOT_FOUND: showmessage('The specified path was not found.');
      

  7.   

    DEPHI下执行DOS命令怎么执行呢而且是在98环境下