473,854 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"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("S cripting.FileSy stemObject")

intProject = 12345
strZipFile = "F:\path\" & intProject & ".zip"

If objFSO.FileExis ts (strZipFile) Then

' extracts .doc and .txt files from zip file - works fine
Set objShell = CreateObject("W Script.Shell")
Set objCmd = objShell.Exec(" c:\Program Files\Winzip\wz unzip.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("W Script.Shell")
Set objCmd = objShell.Exec(" c:\Program Files\Winzip\wz zip -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("W Script.Shell")
Set objCmd = Shell.Exec("c:\ Program Files\pkware\Zi p2Exe
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 23877
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
compatibilit y 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("S cripting.FileSy stemObject")

intProject = 12345
strZipFile = "F:\path\" & intProject & ".zip"

If objFSO.FileExis ts (strZipFile) Then

' extracts .doc and .txt files from zip file - works fine
Set objShell = CreateObject("W Script.Shell")
Set objCmd = objShell.Exec(" c:\Program Files\Winzip\wz unzip.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("W Script.Shell")
Set objCmd = objShell.Exec(" c:\Program Files\Winzip\wz zip -ybc
f:\working\tem p\" & 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("W Script.Shell")
Set objCmd = Shell.Exec("c:\ Program Files\pkware\Zi p2Exe
f:\working\tem p\" & 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.Exe c 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_machinenam e account, did you give that
SPECIFIC user permission?

"Mark DuPrey" <sk****@columbu s.rr.com> wrote in message
news:a6******** *************** ***@posting.goo gle.com...
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("S cripting.FileSy stemObject")

intProject = 12345
strZipFile = "F:\path\" & intProject & ".zip"

If objFSO.FileExis ts (strZipFile) Then

' extracts .doc and .txt files from zip file - works fine
Set objShell = CreateObject("W Script.Shell")
Set objCmd = objShell.Exec(" c:\Program Files\Winzip\wz unzip.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("W Script.Shell")
Set objCmd = objShell.Exec(" c:\Program Files\Winzip\wz zip -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("W Script.Shell")
Set objCmd = Shell.Exec("c:\ Program Files\pkware\Zi p2Exe
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*****@hotmai l.com> wrote in message news:<uk******* *******@TK2MSFT NGP12.phx.gbl>. ..
Your ASP page runs under the IUSR_machinenam e account, did you give that
SPECIFIC user permission?


Yes. Both ISUR_machinenam e and IWAM_machinenam e 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("S cripting.FileSy stemObject")

intProject = 12345
strZipFile = "F:\path\" & intProject & ".zip"

If objFSO.FileExis ts (strZipFile) Then

' extracts .doc and .txt files from zip file - works fine
Set objShell = CreateObject("W Script.Shell")
Set objCmd = objShell.Exec(" c:\Program Files\Winzip\wz unzip.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("W Script.Shell")
Set objCmd = objShell.Exec(" c:\Program Files\Winzip\wz zip -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("W Script.Shell")
Set objCmd = Shell.Exec("c:\ Program Files\pkware\Zi p2Exe
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******@NOyah oo.SPAMcom> wrote in message news:<uW******* *******@TK2MSFT NGP09.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
fnikola
1 New Member
Mark,
I'm having a similar issue and was wondering if you ever resolved the problem.
Thanks!

"Bob Barrows" <reb01501@NOyah oo.SPAMcom> wrote in message news:<uWMhSaKgD HA.2464@TK2MSFT NGP09.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
6127
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 the form is automatically submitted. I'm trying to avoid having seperate browse and submit actions. Can someone explain why I'm getting the error and how I can accomplish this task?
0
1618
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 Roles etc, but I'm clueless ;)
0
1686
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 than the Local Service or Network Service, or System account. I'm running into a problem, though, with trying to instantiate Excel. When I execute the following: using Excel = Microsoft.Office.Interop.Excel; using Microsoft.Office.Core; //...
6
4146
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 had to manually install all of the ODBC drivers and the rest of the DLL's, and now I am getting "Access is Denied" errors on any page that uses ADODB. How do I fix it? I already gave the ODBC drivers in the folders in "c:\program files\common...
0
3540
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 original question, the subject line is: ADODB.NET and "Access Denied" I have an ASP.NET page writtein in VB that uses ADODB. I just had to
2
2754
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 GIF/JPEG/PNG image to disk and then load it into the page using the <IMG /> tag is probably not the tidiest or most secure way of doing this, but it is the easiest and allows the greatest flexibility in terms of positioning. (It also seems to be the most...
0
1789
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. Aside from having administrative rights, I have also put myself in the Debugger Users group. I have added ASPNET and even IUSR_SERVERNAME to the Debuggers group (don't worry, it's a dev server not a live machine) and I still get "Access Denied"...
1
5146
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 local/intranet hosted dynamic HTML page) to Trusted Sites list in IE Options.
0
1620
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 xlSheets As Excel.Sheets Dim xlSheet As Excel.Worksheet xlApp = New Excel.Application
3
1593
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 don't get this error when viewing the page directely in IE. Thank you Noro
0
9899
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10740
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7909
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5738
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5936
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4550
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4147
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3181
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.