By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,835 Members | 1,951 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,835 IT Pros & Developers. It's quick & easy.

"Access is Denied" error when calling wshShell from ASP

P: n/a
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
Jul 19 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
On 17 Sep 2003 07:55:19 -0700, sk****@columbus.rr.com (Mark DuPrey)
wrote:
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 ###
It would help if you told us the line number, and showed the snippet
arond it.
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.


Keep in mind that the command line may work because you're logged in
with a user account that has permission, while the ASP may not because
the user you're running under doesn't. And it's not just the EXE
file, but the input and output files and folders that need appropriate
permissions.

Jeff
Jul 19 '05 #2

P: n/a
jc*************@naplesgov.com (Jeff Cochran) wrote in message
<snip>
It would help if you told us the line number, and showed the snippet
arond it.
The code is in the original message and it's even commented where it
doesn't work. I can't post the actual code without violating a
confidentiality agreement. The only thing that was changed was I
stripped out some code that returned STDOUT from the WinZip command
line and changed the type of files extracted from the .zip.

<snip> Keep in mind that the command line may work because you're logged in
with a user account that has permission, while the ASP may not because
the user you're running under doesn't. And it's not just the EXE
file, but the input and output files and folders that need appropriate
permissions.


I'm aware of the permissions being different for different users. As I
mentioned I have tried to alleviate this and make sure that the
permissions on the executable match. Thanks for the suggestion about
the input/output folders. I'll check that.

Mark DuPrey
Jul 19 '05 #3

P: n/a
Your ASP page runs under the IUSR_machinename account, did you give that
SPECIFIC user permission?

"Mark DuPrey" <sk****@columbus.rr.com> wrote in message
news:a6**************************@posting.google.c om...
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

Jul 19 '05 #4

P: n/a
"Tom B" <sh*****@hotmail.com> wrote in message news:<uk**************@TK2MSFTNGP12.phx.gbl>...
Your ASP page runs under the IUSR_machinename account, did you give that
SPECIFIC user permission?


Yes. Both ISUR_machinename and IWAM_machinename both have full
permissions to the executable and the directories it accesses.

Mark DuPrey
Jul 19 '05 #5

P: n/a
Is f: a local drive? or a map to a drive on another machine? If the latter,
then IUSR_ probably does not have the rights it needs. To access files on
another box, you need a domain user account. IUSR is a local account.

Hmm, that makes me wonder how the previous lines can be working with no
error ...

Bob Barrows

Mark DuPrey wrote:
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


Jul 19 '05 #6

P: n/a
"Bob Barrows" <re******@NOyahoo.SPAMcom> wrote in message news:<uW**************@TK2MSFTNGP09.phx.gbl>...
Is f: a local drive? or a map to a drive on another machine? If the latter,
then IUSR_ probably does not have the rights it needs. To access files on
another box, you need a domain user account. IUSR is a local account.

Hmm, that makes me wonder how the previous lines can be working with no
error ...

Bob Barrows


f: is a local drive and as I mentioned the IUSR and IWAM accounts both
have full permissions on the executable and the directories it
accesses

Even though I haven't made any progress, thanks to all who have
offered suggestions so far.

Mark DuPrey
Jul 19 '05 #7

P: 1
Mark,
I'm having a similar issue and was wondering if you ever resolved the problem.
Thanks!

"Bob Barrows" <reb01501@NOyahoo.SPAMcom> wrote in message news:<uWMhSaKgDHA.2464@TK2MSFTNGP09.phx.gbl>...[color=blue]
> Is f: a local drive? or a map to a drive on another machine? If the latter,
> then IUSR_ probably does not have the rights it needs. To access files on
> another box, you need a domain user account. IUSR is a local account.
>
> Hmm, that makes me wonder how the previous lines can be working with no
> error ...
>
> Bob Barrows[/color]

f: is a local drive and as I mentioned the IUSR and IWAM accounts both
have full permissions on the executable and the directories it
accesses

Even though I haven't made any progress, thanks to all who have
offered suggestions so far.

Mark DuPrey
Jun 13 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.