我想刪除一程序路徑如下:
extractfilename(application.exename)+'mysoft.exe';
請問問號處如何寫??
winexec('command.com / c del ????',sw_normal);

解决方案 »

  1.   

    str:=extractfilename(application.exename)+'mysoft.exe';
    winexec('command.com / c del'+ str,sw_normal);
      

  2.   

    DeleteFile(Pchar(ExtractFileName(Application.ExeName)+'mysoft.exe'))
      

  3.   

    To: xxyzjf(FaceToFace)
    我用你的方法,但編譯時出現:
    incompatiable types :'string' and 'pchar';
    改寫
    winexec('command.com / c del'+ pchar(str),sw_normal)也一樣.
    請問如何解決??
    delefile可行,但仍想弄清以上問題,煩指教.
    (不好意思,應該是extractfilepath......)
      

  4.   

    winexec(PChar('command.com / c del'+ str),sw_normal);
    强制类型转化!
    为什么不用DeleteFile呢,而用Dos命令呢?