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

Error 800a0046 when trying to run a program

P: n/a
I'm trying to run a batch file from an asp page using WScript.Shell object.

Dim oWSH
set oWSH= Server.CreateObject("WScript.Shell")
call oWSH.Run("cmd.exe /c " & szCmd , 0, true)

szCmd contains the program to execute (fop.bat with several parameters).

But I'm getting the following error message :

Microsoft VBScript runtime error '800a0046'
Permission denied
The IUSR_xxxx has full control access to the directory containing the asp
page.
Works fine on a Windows 2000 Server but not on an 2003 server.
Jul 19 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Do you have any antivirus software running on the server that may prevent
the creation of WScript.Shell, perhaps?

Ray at work

"Patrice FRITSCH" <pa*************@NOSPAM.com> wrote in message
news:e2**************@tk2msftngp13.phx.gbl...
I'm trying to run a batch file from an asp page using WScript.Shell
object.

Dim oWSH
set oWSH= Server.CreateObject("WScript.Shell")
call oWSH.Run("cmd.exe /c " & szCmd , 0, true)

szCmd contains the program to execute (fop.bat with several parameters).

But I'm getting the following error message :

Microsoft VBScript runtime error '800a0046'
Permission denied
The IUSR_xxxx has full control access to the directory containing the asp
page.
Works fine on a Windows 2000 Server but not on an 2003 server.

Jul 19 '05 #2

P: n/a
Yes I have McAfee VirusScan Entreprise installed.
Works fine with my Win2KServer having also Viruscan installed.

I will have a try with VirusScan disabled.
Thanks.

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> a écrit dans
le message de news:%2*****************@TK2MSFTNGP09.phx.gbl...
Do you have any antivirus software running on the server that may prevent
the creation of WScript.Shell, perhaps?

Ray at work

"Patrice FRITSCH" <pa*************@NOSPAM.com> wrote in message
news:e2**************@tk2msftngp13.phx.gbl...
I'm trying to run a batch file from an asp page using WScript.Shell
object.

Dim oWSH
set oWSH= Server.CreateObject("WScript.Shell")
call oWSH.Run("cmd.exe /c " & szCmd , 0, true)

szCmd contains the program to execute (fop.bat with several parameters).

But I'm getting the following error message :

Microsoft VBScript runtime error '800a0046'
Permission denied
The IUSR_xxxx has full control access to the directory containing the asp page.
Works fine on a Windows 2000 Server but not on an 2003 server.


Jul 19 '05 #3

P: n/a
Hello Ray,

Running oWSH.Run("cmd.exe /c dir > toto.txt", 0, true) works fine
Running oWSH.Run("cmd.exe /c toto.bat > toto.txt", 0, true) does'nt work
(toto.bat contains only one line : DIR !!!)
Is there something else that can prevent the running of a batch file ?
Do you have any antivirus software running on the server that may prevent
the creation of WScript.Shell, perhaps?

Ray at work

"Patrice FRITSCH" <pa*************@NOSPAM.com> wrote in message
news:e2**************@tk2msftngp13.phx.gbl...
I'm trying to run a batch file from an asp page using WScript.Shell
object.

Dim oWSH
set oWSH= Server.CreateObject("WScript.Shell")
call oWSH.Run("cmd.exe /c " & szCmd , 0, true)

szCmd contains the program to execute (fop.bat with several parameters).

But I'm getting the following error message :

Microsoft VBScript runtime error '800a0046'
Permission denied
The IUSR_xxxx has full control access to the directory containing the asp page.
Works fine on a Windows 2000 Server but not on an 2003 server.


Jul 19 '05 #4

P: n/a
Can you post all of your code, or at least all that is relevant here? See,
you shouldn't be getting access denied's based on what the batch file is
doing. If you (iusr) have access to cmd.exe, that's about as far as ASP can
"see." If the batch file is trying to do something unauthorized, this error
would be returned to the stdout from the command prompt, which would not be
bounced back into an ASP error. Like, if you ran "cmd.exe /c net start
[some service]" and your IUSR account isn't authorized to do this, you would
not see this error. Now, if your IUSR didn't have NTFS permissions to
cmd.exe, for example, then you'd see a permission denied error.

Are you positive that your iusr account is authorized to access cmd.exe?

Ray at work

"Patrice FRITSCH" <pa*************@NOSPAM.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hello Ray,

Running oWSH.Run("cmd.exe /c dir > toto.txt", 0, true) works fine
Running oWSH.Run("cmd.exe /c toto.bat > toto.txt", 0, true) does'nt work
(toto.bat contains only one line : DIR !!!)
Is there something else that can prevent the running of a batch file ?
Do you have any antivirus software running on the server that may prevent
the creation of WScript.Shell, perhaps?

Ray at work

"Patrice FRITSCH" <pa*************@NOSPAM.com> wrote in message
news:e2**************@tk2msftngp13.phx.gbl...
> I'm trying to run a batch file from an asp page using WScript.Shell
> object.
>
> Dim oWSH
> set oWSH= Server.CreateObject("WScript.Shell")
> call oWSH.Run("cmd.exe /c " & szCmd , 0, true)
>
> szCmd contains the program to execute (fop.bat with several
> parameters).
>
> But I'm getting the following error message :
>
> Microsoft VBScript runtime error '800a0046'
> Permission denied
>
>
> The IUSR_xxxx has full control access to the directory containing the asp > page.
> Works fine on a Windows 2000 Server but not on an 2003 server.
>
>



Jul 19 '05 #5

P: n/a
Ray,

Here is my code

set WSH= Server.CreateObject("WScript.Shell")
' szCmd = "c:\fop-0.20.5\fop.bat -xml " & Server.MapPath("./SH005303.xml")
& " -xsl " & Server.MapPath("./InstallReport.xsl") & " -pdf " &
Server.MapPath("./SH005303.pdf") & " > " & Server.MapPath("./log_fop.txt")
' szCmd = "%COMSPEC% /c " & Server.MapPath("./toto.bat") & " > " &
Server.MapPath("./log_fop.txt")
szCmd = "%COMSPEC% /c dir > " & Server.MapPath("./log_fop.txt")
x=WSH.Run(szCmd, , true)
response.Write("Run error = " & x)
set WSH = nothing

I don't have the 800a0046 error anymore :-)
When I'm running "cmd.exe /c dir > file.txt" everything works fine and
WSH.run return 0
But when I'm running cmd.exe /c toto.bat > file.txt I, WSH.run return 1
(toto.bat contains the dir command).

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> a écrit dans
le message de news:eZ*************@TK2MSFTNGP11.phx.gbl...
Can you post all of your code, or at least all that is relevant here? See, you shouldn't be getting access denied's based on what the batch file is
doing. If you (iusr) have access to cmd.exe, that's about as far as ASP can "see." If the batch file is trying to do something unauthorized, this error would be returned to the stdout from the command prompt, which would not be bounced back into an ASP error. Like, if you ran "cmd.exe /c net start
[some service]" and your IUSR account isn't authorized to do this, you would not see this error. Now, if your IUSR didn't have NTFS permissions to
cmd.exe, for example, then you'd see a permission denied error.

Are you positive that your iusr account is authorized to access cmd.exe?

Ray at work

"Patrice FRITSCH" <pa*************@NOSPAM.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hello Ray,

Running oWSH.Run("cmd.exe /c dir > toto.txt", 0, true) works fine
Running oWSH.Run("cmd.exe /c toto.bat > toto.txt", 0, true) does'nt work (toto.bat contains only one line : DIR !!!)
Is there something else that can prevent the running of a batch file ?
Do you have any antivirus software running on the server that may prevent the creation of WScript.Shell, perhaps?

Ray at work

"Patrice FRITSCH" <pa*************@NOSPAM.com> wrote in message
news:e2**************@tk2msftngp13.phx.gbl...
> I'm trying to run a batch file from an asp page using WScript.Shell
> object.
>
> Dim oWSH
> set oWSH= Server.CreateObject("WScript.Shell")
> call oWSH.Run("cmd.exe /c " & szCmd , 0, true)
>
> szCmd contains the program to execute (fop.bat with several
> parameters).
>
> But I'm getting the following error message :
>
> Microsoft VBScript runtime error '800a0046'
> Permission denied
>
>
> The IUSR_xxxx has full control access to the directory containing the

asp
> page.
> Works fine on a Windows 2000 Server but not on an 2003 server.
>
>



Jul 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.