473,386 Members | 1,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

"Access is Denied" error when calling wshShell from ASP

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
7 23788
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
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
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
"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
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
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Noozer | last post by:
The following javascript code generates an "Access denied" error at the indicated line. This sample should allow the user to click "Browse" and choose a file. Once the user has selected a file...
0
by: Oliver | last post by:
hi - I have a written a "Serviced Component" which works fine when declared as: but I am seeing an 'Access Denied' exception when I declare it as: this is probably something to do with...
0
by: Jon Rista | last post by:
Hello. I'm trying to automate Excel in a C# Windows Service. This windows service has to be able to access files on network shares, so it uses a domain account on a WinNT 4.0 domain server, rather...
6
by: ASP.Confused | last post by:
I have an ASP.NET page writtein in VB that uses ADODB. I just had to force-install MDAC 2.8 after I tried to rollback to 2.6 (my web host uses this, and I wanted to be compatible with them.) I...
0
by: ASP.Confused | last post by:
The old message looked a little stale, so I am re-posting it here. Anybody have any ideas of what I could do?!? The previous responses to this question are below. If you want to look at the...
2
by: Loane Sharp | last post by:
Hi there I'm using VB.NET and Office Web Components to access a SQL Server 2005 Express database and draw pictures on the fly in my ASP.NET application. Using .ExportPicture to write the...
0
by: Rico | last post by:
Helolo, I have an ASP.NET application on a Windows 2003 Server machine WITHOUT VS. I am working on an XPPro machine with VS 2003. I have installed the remote debugging components on the server....
1
by: srivatsans101 | last post by:
Hi, I'm trying to access the IFrame contents on a HTML page as frames.document But in IE, I'm getting Access Denied Error Message. I tried to add the IFrame's Src WebSite (a...
0
by: =?Utf-8?B?TW9udGU=?= | last post by:
I am using VB.NET to open and read info from Excel spreadsheets using code similar to this: Dim xlApp As Excel.Application Dim xlBook As Excel.Workbook Dim xlBooks As Excel.Workbooks Dim...
3
by: noureddine | last post by:
When I create a folder in outlook and give it a homepage url to an ajax asp.net page I've developed, I get ajax errors on my page when viewed in outlook. The Error is : "Access is denied". I...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.