调用winrar无法压缩文件成zip

qq_34590761 2017-10-31 09:28:16
thispath=server.mappath(".")&"\" '存放RAR.EXE和CMD.EXE的路径
zipfolder=server.mappath(".")&"\*.xml" '要压缩的文件或文件夹
rarfile = server.mappath(".")&"\date.zip"
Set Shell = Server.CreateObject("WScript.Shell")
if err.number<>0 then
response.write "服务器不支持"
response.end
end if
cmd= thispath&"cmd.exe /c "&thispath&"winrar.exe a "&rarfile&" "&zipfolder&""
RetCode = Shell.Run(cmd,1,True)
response.write "执行成功!"
if err.number<>0 then
response.write ""&RetCode&""
else
response.write err.description
end If

高手帮忙看下这段代码哪里有问题,为什么无法压缩成zip文件呢?
...全文
373 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Dogfish 2017-11-08
  • 打赏
  • 举报
回复
楼主看看这个链接 http://cects.com/using-the-winrar-command-line-tools-in-windows/
Dogfish 2017-11-08
  • 打赏
  • 举报
回复
有命令行版本的winrar的。应该是根据文件后缀就能生成zip的。
itakeblue 2017-11-08
  • 打赏
  • 举报
回复
试试看用7zip吧,命令行版本为7za.exe,和rar不是一个级别的

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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