调用WinRAR时出现的问题

mableboy 2003-03-27 09:39:25
我在调用WinRAR时,遇到了这样一个问题,不知道有没有人碰到过:
在winrar 命令格式中,是用空格来作为文件间隔的,而windows中有一个很特殊的文件夹Documents and Settings,winrar在运行时,会把它看成三个文件,导致出错,请问有什么解决办法?谢谢!

ShellExecute(handle,'open',pchar('winrar'),pchar('a D:\ttt D:\ttt.doc),nil, SW_HIDE);
时能正确运行,

ShellExecute(handle,'open',pchar('winrar'),pchar('a D:\ttt C:\Documents and Settings\ttt.doc),nil, SW_HIDE);
就不对了!
...全文
81 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
softboysxp 2003-03-30
  • 打赏
  • 举报
回复
加上双引号
mableboy 2003-03-27
  • 打赏
  • 举报
回复
对了!
谢谢大家!
高手就是高手!
强!
guestman 2003-03-27
  • 打赏
  • 举报
回复
追加文件C:\Docume~1\ttt.doc到D:\ttt\a.rar中:
ShellExecute(handle,'open',pchar('winrar'),pchar('a D:\ttt\a.rar D:\ttt.doc'),nil, SW_HIDE);
测试通过
alphax 2003-03-27
  • 打赏
  • 举报
回复
给路径名加上引号,因为你的路径名中包含空格
mrfanghansheng 2003-03-27
  • 打赏
  • 举报
回复
呵呵,我们的处理方法一般是把要操作的文件copy到现在的目录下,然后调用rar时用相对路径
mableboy 2003-03-27
  • 打赏
  • 举报
回复
谢谢!
不过还是不行,恐怕不是长文件名问题.
winrar错误提示是:

! 无法打开 C:\documents
系统找不到指定的文件。
! 无法打开 and
系统找不到指定的文件。
! 无法打开 Settings\1.doc
系统找不到指定的路径。
! 没有文件被添加


guestman 2003-03-27
  • 打赏
  • 举报
回复
是不是不支持长文件名啊
你试试:
ShellExecute(handle,'open',pchar('winrar'),pchar('a D:\ttt C:\Docume~1\ttt.doc),nil, SW_HIDE);

1,183

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧