M
Mark DuPrey
I've got a script in an ASP page that is supposed to extract certain
files from a zip file, move them, create a new zip with the moved
files and then make a self-extracting archive out of the new zip file.
I'm doing this using wshShell.Exec, the WinZip command line tool and
zip2exe.exe from the pkware suite (because WinZip's command line
doesn't support creating self-extracting archives and for historical
compatibility reasons). This is running on Windows 2000 Server and IIS
5.0 both fully patched as of yesterday. The relevant code is below:
set objFSO = CreateObject("Scripting.FileSystemObject")
intProject = 12345
strZipFile = "F:\path\" & intProject & ".zip"
If objFSO.FileExists (strZipFile) Then
' extracts .doc and .txt files from zip file - works fine
Set objShell = CreateObject("WScript.Shell")
Set objCmd = objShell.Exec("c:\Program Files\Winzip\wzunzip.exe -O-
" & strZipFile & " *.doc *.txt f:\working\doc\")
set objCmd = Nothing
Set objShell = Nothing
' makes new zip file in a different directory from extracted .doc
and .txt files - works fine
Set objShell = CreateObject("WScript.Shell")
Set objCmd = objShell.Exec("c:\Program Files\Winzip\wzzip -ybc
f:\working\temp\" & intProject & ".zip f:\working\doc\*" & intProject
& ".doc f:\working\doc\*" & intProject & ".txt")
set objCmd = Nothing
Set objShell = Nothing
' makes self-extracting .exe in a different directory from new zip
file - fails every time
Set objShell = CreateObject("WScript.Shell")
Set objCmd = Shell.Exec("c:\Program Files\pkware\Zip2Exe
f:\working\temp\" & intProject & ".zip f:\working\exe\")
set objCmd = Nothing
Set objShell = Nothing
End If
set objFSO = Nothing
Executing the WinZip command-line programs from the page works fine.
Every time I try to execute Zip2Exe I get:
WshShell.Exec error '80070005'
Access is denied.
/myfile.asp, line ###
I've changed the permissions on Zip2Exe to match the permissions on
the WinZip tools wzzip and wzunzip to no avail. I've tried writing a
batch file that is called by wshShell.Exec and having that call
Zip2Exe with no luck. The Zip2Exe command does work if executed
manually on the command line so I know the program and the command
both work. It's obviously a permissions problem but I'm stumped as
where to look next. Any suggestions will be greatly appreciated.
Mark DuPrey
files from a zip file, move them, create a new zip with the moved
files and then make a self-extracting archive out of the new zip file.
I'm doing this using wshShell.Exec, the WinZip command line tool and
zip2exe.exe from the pkware suite (because WinZip's command line
doesn't support creating self-extracting archives and for historical
compatibility reasons). This is running on Windows 2000 Server and IIS
5.0 both fully patched as of yesterday. The relevant code is below:
set objFSO = CreateObject("Scripting.FileSystemObject")
intProject = 12345
strZipFile = "F:\path\" & intProject & ".zip"
If objFSO.FileExists (strZipFile) Then
' extracts .doc and .txt files from zip file - works fine
Set objShell = CreateObject("WScript.Shell")
Set objCmd = objShell.Exec("c:\Program Files\Winzip\wzunzip.exe -O-
" & strZipFile & " *.doc *.txt f:\working\doc\")
set objCmd = Nothing
Set objShell = Nothing
' makes new zip file in a different directory from extracted .doc
and .txt files - works fine
Set objShell = CreateObject("WScript.Shell")
Set objCmd = objShell.Exec("c:\Program Files\Winzip\wzzip -ybc
f:\working\temp\" & intProject & ".zip f:\working\doc\*" & intProject
& ".doc f:\working\doc\*" & intProject & ".txt")
set objCmd = Nothing
Set objShell = Nothing
' makes self-extracting .exe in a different directory from new zip
file - fails every time
Set objShell = CreateObject("WScript.Shell")
Set objCmd = Shell.Exec("c:\Program Files\pkware\Zip2Exe
f:\working\temp\" & intProject & ".zip f:\working\exe\")
set objCmd = Nothing
Set objShell = Nothing
End If
set objFSO = Nothing
Executing the WinZip command-line programs from the page works fine.
Every time I try to execute Zip2Exe I get:
WshShell.Exec error '80070005'
Access is denied.
/myfile.asp, line ###
I've changed the permissions on Zip2Exe to match the permissions on
the WinZip tools wzzip and wzunzip to no avail. I've tried writing a
batch file that is called by wshShell.Exec and having that call
Zip2Exe with no luck. The Zip2Exe command does work if executed
manually on the command line so I know the program and the command
both work. It's obviously a permissions problem but I'm stumped as
where to look next. Any suggestions will be greatly appreciated.
Mark DuPrey