I am trying to zip a folder from an asp page. This is my code:
zipFolderName=folderName &"Zipped.zip"
command="cd C:\Program Files\7-Zip & "
command = command & "7z a -tzip " & zipFolderName & " """ & folderName & """"
Response.Write command
set objshell = Server.CreateObject("WScript.shell")
objShell.exec (command)
set objshell=nothing
The command that is written in the Response.Write
is
cd C:\Program Files\7-Zip & 7z a -tzip D:/saveAll/DocumentsZipped.zip "D:/saveAll/Documents"
When I run this command in a cmd window it works just fine. But my asp page shows an error:
WshShell.Exec error '80070002'
The system cannot find the file specified.
The error is on the objShell.exe command-line.
What am I doing wrong? Please help!