呵呵,如果你的文件名不是带完整的路径信息,你是难以找到其所在目录的,但如果它本身就带完整路径的话,你可以用ExtractFilePath或ExtractFileDir函数取出文件名中的路径部分,就是你要的目录名了!

解决方案 »

  1.   

    这个已试过,假设知文件KV3000.EXE ,而不知其所在目录,怎能得到其所在目录
      

  2.   

    呵呵,用FileSearch()函数试试吧,你自己看Delphi的帮助吧!
      

  3.   

    用FileSearch()函数试试,是在当前目录用
      

  4.   

    用ExpandFileName.
    ExpandFileName converts the relative file name into a fully qualified path name by merging in the current drive and directory. A fully qualified path name includes the drive letter and any directory and subdirectories in addition to the file name and extension. ExpandFileName does not verify that the resulting fully qualified path name refers to an existing file, or even that the resulting path exists.Note: ExpandFileName does not support UNC format. To expand to a UNC file name, use ExpandUNCFileName.
      

  5.   

    用什么命令搜索遍历整个硬盘
    to:angel79(无私天使)
      

  6.   

    把“dir kv2000.exe /s"输出重定向到文本中,再进行判断
      

  7.   

    有谁写过DLL之类的东东拿出来共享一下?!大家就不会觉得烦了!