请教:
dim ylj,ywj,Mlpath,Shell,rarcomm,RetCode,cmd,comm,fso unfilepath=Request.ServerVariables("PATH_INFO")
'存放RAR.EXE和CMD.EXE的路径
Mlpath=Replace(Server.mappath(unfilepath),"rar.asp","") afterzip=Server.mappath("dos")&"\"
ylj=afterzip
'要压缩的RAR文件
needzip=Server.mappath("admin.rar")
ywj=needzip Set Shell = Server.CreateObject("WScript.Shell") rarcomm= Mlpath&"cmd.exe /c "&Mlpath&"rar.exe d"&" "&ywj&" *.asp" cmd=rarcomm response.write cmd
retcode= Shell.Run(cmd,1,true)
response.write retcode
总是不执行,而且返回的retcode=2
如果直接执行那个CMD命令没有错误
dim ylj,ywj,Mlpath,Shell,rarcomm,RetCode,cmd,comm,fso unfilepath=Request.ServerVariables("PATH_INFO")
'存放RAR.EXE和CMD.EXE的路径
Mlpath=Replace(Server.mappath(unfilepath),"rar.asp","") afterzip=Server.mappath("dos")&"\"
ylj=afterzip
'要压缩的RAR文件
needzip=Server.mappath("admin.rar")
ywj=needzip Set Shell = Server.CreateObject("WScript.Shell") rarcomm= Mlpath&"cmd.exe /c "&Mlpath&"rar.exe d"&" "&ywj&" *.asp" cmd=rarcomm response.write cmd
retcode= Shell.Run(cmd,1,true)
response.write retcode
总是不执行,而且返回的retcode=2
如果直接执行那个CMD命令没有错误
解决方案 »
- 关于图片幻灯切换的问题。
- 有的网站空间不支持vs2008
- POPUPWIN弹出动态多个窗口,怎么做?
- [求助]服务器数据如何传递到页面的javascript
- 在WCF中使用NetTCP进行传输,服务器端如何传递用户信息?
- 如何在ASP.NET中 将*.aspx编译成*.dll 文件?
- 数据插入是不是用executeNonQuery方法阿?
- 如何设置datagrid中的DropDownList显示的是绑定记录的当前数据?
- 水晶报表在WEB页面中怎么打印??
- 请问如何实现手机和电脑都可以在线看DOC/XLS/PDF格式的上传文档
- 我把数据库连接部分写到一个类中,为什么编译总是出错误?
- JavaScript如何把字符形改为数字形?
当时给我的错误提示是权限不够之类的回答
后来我把同样的代码写成类封装成一个控件就没有问题,我也不知道为什么能行,但成功了
那个类的代码在如下地址:
http://community.csdn.net/Expert/topic/3626/3626980.xml?temp=.6795465
详细代码在第五楼