各位好
ASP利用7Z解壓縮檔案
Response.Write "<BR><BR>解壓縮 : /a004 解壓到 /tempfiles **************************** <BR>"
'來源 zipFolderNamed
'目的 unzip2folderName
unzip2folderName = Server.mappath("../tempfiles/")
command = "%COMSPEC% /c cd ""C:\Program Files (x86)\7-Zip"" & "
command = command & "7z x " & zipFolderNamed & " -o" & unzip2folderName
Response.Write command
set objshell = Server.CreateObject("WScript.shell")
objShell.exec (command)
set objshell=nothing
202-5-19 問題解決
command = "%COMSPEC% /c cd ""C:\Program Files (x86)\7-Zip"" & "
command = command & "7z x " & zipFolderNamed & " -o" & unzip2folderName &"\"
在 unzip2folderName 後面加一 \
cmd: cd C:\Program Files (x86)\7-Zip
cmd: 7z x E:\wwwroot\_mytest\a004\20200518154618.zip -oE:\wwwroot\_mytest\tempfiles
'來源
zipFolderNames = Server.mappath("../a003/")
'目的
folderName=Server.mappath("../a004/")
filename = year(date()) & right( "0"& month(date()) ,2) & right( "0"& day(date()) ,2) & right( "0"& hour(now()) ,2) & right( "0"& Minute(now()) ,2) & right( "0"& second(now()) ,2) & right(SMT_pic,4)
zipFolderNamed= folderName &"\"& filename &".zip"
'目的zipFolderNamed 放前
command = "%COMSPEC% /c cd ""C:\Program Files (x86)\7-Zip"" & "
command = command & "7z a -tzip " & zipFolderNamed & " """ & zipFolderNames & """"
Response.Write command
set objshell = Server.CreateObject("WScript.shell")
objShell.exec (command)
set objshell=nothing
請問我的ASP寫法哪裡出問題? 請各位幫忙!
先謝謝各位幫忙!