473,908 Members | 6,345 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

wscript.shell error

People; i'm from argentina so , sorry, but my english isnīt good...

Now, the question is; I'm trying to run a *.bat program on an ASP page,
with the wsh script, but i canīt do it... because i obtain an error code (5
access denied)
I let you the code that iīm using, so you can help me

Dim wshell, proc set wshell = server.createob ject("wscript.s hell")

prg="%comspec% /c net stop dns"
set proc = wshell.exec(prg )

Do While proc.Status < 1

Loop
Response.Write prg & "<br>"
Response.Write proc.StdOut.Rea dAll & "<br>"
Response.Write proc.stderr.rea dAll & "<br>"
set wshell = nothing

.....

I tried besides, the "run" methon instead of "exec", but the result is the
same...
so ... help!!!
I have gave permissons (total control) to IWAM and IUSR users on the page
folder, and on cmd.exe program and net.exe program; but there isnīt case, it
doesnīt work...

Thanks for your suggestions; and sorry about my english... If you donīt
understand my , let me knot that, and i try to explain better...

Ferg

May 10 '06 #1
6 6536
In addition to needing NTFS permissions to the executables, the user account
executing the command needs permissions to run the command, itself. Someone
who is a GUEST, such as IUSR doesn't have the rights in Windows to start and
stop services. You could add your iusr account to the admin group (not real
advised) or run that page with a different anonymous account that is an
admin (a bit safer).

Ray at work

"ferg" <fgiletta@solso ft(punto)com(pu nto)ar> wrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
People; i'm from argentina so , sorry, but my english isnīt good...

Now, the question is; I'm trying to run a *.bat program on an ASP page,
with the wsh script, but i canīt do it... because i obtain an error code
(5 access denied)
I let you the code that iīm using, so you can help me

Dim wshell, proc set wshell = server.createob ject("wscript.s hell")

prg="%comspec% /c net stop dns"
set proc = wshell.exec(prg )

Do While proc.Status < 1

Loop
Response.Write prg & "<br>"
Response.Write proc.StdOut.Rea dAll & "<br>"
Response.Write proc.stderr.rea dAll & "<br>"
set wshell = nothing

....

I tried besides, the "run" methon instead of "exec", but the result is the
same...
so ... help!!!
I have gave permissons (total control) to IWAM and IUSR users on the page
folder, and on cmd.exe program and net.exe program; but there isnīt case,
it doesnīt work...

Thanks for your suggestions; and sorry about my english... If you donīt
understand my , let me knot that, and i try to explain better...

Ferg

May 10 '06 #2
Thank you Ray, but what do you mean when you say "...or run that page with a
different anonymous account that is an
admin (a bit safer)." . How can i run the page with a different anonymous
account ? ...

Thanks again
Ferg

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> escribió en
el mensaje news:uz******** ******@TK2MSFTN GP04.phx.gbl...
In addition to needing NTFS permissions to the executables, the user
account executing the command needs permissions to run the command,
itself. Someone who is a GUEST, such as IUSR doesn't have the rights in
Windows to start and stop services. You could add your iusr account to
the admin group (not real advised) or run that page with a different
anonymous account that is an admin (a bit safer).

Ray at work

"ferg" <fgiletta@solso ft(punto)com(pu nto)ar> wrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
People; i'm from argentina so , sorry, but my english isnīt good...

Now, the question is; I'm trying to run a *.bat program on an ASP page,
with the wsh script, but i canīt do it... because i obtain an error code
(5 access denied)
I let you the code that iīm using, so you can help me

Dim wshell, proc set wshell = server.createob ject("wscript.s hell")

prg="%comspec% /c net stop dns"
set proc = wshell.exec(prg )

Do While proc.Status < 1

Loop
Response.Write prg & "<br>"
Response.Write proc.StdOut.Rea dAll & "<br>"
Response.Write proc.stderr.rea dAll & "<br>"
set wshell = nothing

....

I tried besides, the "run" methon instead of "exec", but the result is
the same...
so ... help!!!
I have gave permissons (total control) to IWAM and IUSR users on the page
folder, and on cmd.exe program and net.exe program; but there isnīt case,
it doesnīt work...

Thanks for your suggestions; and sorry about my english... If you donīt
understand my , let me knot that, and i try to explain better...

Ferg



May 10 '06 #3
It's a configuration in IIS. You can set this at a site, application, or
file level. To do it at the file level for example:

- Create a new local account on the machine called "testaccoun t" or
something along those lines.

- Add this account to the local administrators group on the machine

- in IIS, browse to the file with the code in question. Right click ---
Properties

- Go to the File Security tab

- Under "Anonymous access and authentication control" click the Edit...
button

- Make sure that Anonymous access is checked

- Change the account from IUSR_... to this new test account and enter the
password.

Ray at work

"ferg" <fgiletta@solso ft(punto)com(pu nto)ar> wrote in message
news:%2******** **********@TK2M SFTNGP04.phx.gb l...
Thank you Ray, but what do you mean when you say "...or run that page with
a different anonymous account that is an
admin (a bit safer)." . How can i run the page with a different anonymous
account ? ...

Thanks again
Ferg

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> escribió en
el mensaje news:uz******** ******@TK2MSFTN GP04.phx.gbl...
In addition to needing NTFS permissions to the executables, the user
account executing the command needs permissions to run the command,
itself. Someone who is a GUEST, such as IUSR doesn't have the rights in
Windows to start and stop services. You could add your iusr account to
the admin group (not real advised) or run that page with a different
anonymous account that is an admin (a bit safer).

Ray at work

"ferg" <fgiletta@solso ft(punto)com(pu nto)ar> wrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
People; i'm from argentina so , sorry, but my english isnīt good...

Now, the question is; I'm trying to run a *.bat program on an ASP page,
with the wsh script, but i canīt do it... because i obtain an error code
(5 access denied)
I let you the code that iīm using, so you can help me

Dim wshell, proc set wshell = server.createob ject("wscript.s hell")

prg="%comspec% /c net stop dns"
set proc = wshell.exec(prg )

Do While proc.Status < 1

Loop
Response.Write prg & "<br>"
Response.Write proc.StdOut.Rea dAll & "<br>"
Response.Write proc.stderr.rea dAll & "<br>"
set wshell = nothing

....

I tried besides, the "run" methon instead of "exec", but the result is
the same...
so ... help!!!
I have gave permissons (total control) to IWAM and IUSR users on the
page folder, and on cmd.exe program and net.exe program; but there isnīt
case, it doesnīt work...

Thanks for your suggestions; and sorry about my english... If you donīt
understand my , let me knot that, and i try to explain better...

Ferg



May 10 '06 #4
Thank you Ray; but it doesnīt work
it is still returning error 5, access denied...
I did everything you tell me, but it doesnīt work...
I donīt know what is going on...

Do you have any idea?...
Thank you again...
Ferg from Argentina

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> escribió en
el mensaje news:uG******** ******@TK2MSFTN GP04.phx.gbl...
It's a configuration in IIS. You can set this at a site, application, or
file level. To do it at the file level for example:

- Create a new local account on the machine called "testaccoun t" or
something along those lines.

- Add this account to the local administrators group on the machine

- in IIS, browse to the file with the code in question. Right click ---
Properties

- Go to the File Security tab

- Under "Anonymous access and authentication control" click the Edit...
button

- Make sure that Anonymous access is checked

- Change the account from IUSR_... to this new test account and enter the
password.

Ray at work

"ferg" <fgiletta@solso ft(punto)com(pu nto)ar> wrote in message
news:%2******** **********@TK2M SFTNGP04.phx.gb l...
Thank you Ray, but what do you mean when you say "...or run that page
with a different anonymous account that is an
admin (a bit safer)." . How can i run the page with a different anonymous
account ? ...

Thanks again
Ferg

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> escribió
en el mensaje news:uz******** ******@TK2MSFTN GP04.phx.gbl...
In addition to needing NTFS permissions to the executables, the user
account executing the command needs permissions to run the command,
itself. Someone who is a GUEST, such as IUSR doesn't have the rights in
Windows to start and stop services. You could add your iusr account to
the admin group (not real advised) or run that page with a different
anonymous account that is an admin (a bit safer).

Ray at work

"ferg" <fgiletta@solso ft(punto)com(pu nto)ar> wrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
People; i'm from argentina so , sorry, but my english isnīt good...

Now, the question is; I'm trying to run a *.bat program on an ASP
page, with the wsh script, but i canīt do it... because i obtain an
error code (5 access denied)
I let you the code that iīm using, so you can help me

Dim wshell, proc set wshell = server.createob ject("wscript.s hell")

prg="%comspec% /c net stop dns"
set proc = wshell.exec(prg )

Do While proc.Status < 1

Loop
Response.Write prg & "<br>"
Response.Write proc.StdOut.Rea dAll & "<br>"
Response.Write proc.stderr.rea dAll & "<br>"
set wshell = nothing

....

I tried besides, the "run" methon instead of "exec", but the result is
the same...
so ... help!!!
I have gave permissons (total control) to IWAM and IUSR users on the
page folder, and on cmd.exe program and net.exe program; but there
isnīt case, it doesnīt work...

Thanks for your suggestions; and sorry about my english... If you donīt
understand my , let me knot that, and i try to explain better...

Ferg





May 10 '06 #5
I'm experiencing that also. It must have to do with the act of starting and
stopping services, as when I change the command to:

prg="%comspec% /c net send %computername% test"

That executes fine.

I played around with various local security policies on my machine (XP Pro
SP2) and was unable to get it to execute.

Ray at work
"ferg" <fgiletta@solso ft(punto)com(pu nto)ar> wrote in message
news:u9******** ******@TK2MSFTN GP02.phx.gbl...
Thank you Ray; but it doesnīt work
it is still returning error 5, access denied...
I did everything you tell me, but it doesnīt work...
I donīt know what is going on...

Do you have any idea?...
Thank you again...
Ferg from Argentina

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> escribió en
el mensaje news:uG******** ******@TK2MSFTN GP04.phx.gbl...
It's a configuration in IIS. You can set this at a site, application, or
file level. To do it at the file level for example:

- Create a new local account on the machine called "testaccoun t" or
something along those lines.

- Add this account to the local administrators group on the machine

- in IIS, browse to the file with the code in question. Right click ---
Properties

- Go to the File Security tab

- Under "Anonymous access and authentication control" click the Edit...
button

- Make sure that Anonymous access is checked

- Change the account from IUSR_... to this new test account and enter the
password.

Ray at work

"ferg" <fgiletta@solso ft(punto)com(pu nto)ar> wrote in message
news:%2******** **********@TK2M SFTNGP04.phx.gb l...
Thank you Ray, but what do you mean when you say "...or run that page
with a different anonymous account that is an
admin (a bit safer)." . How can i run the page with a different
anonymous account ? ...

Thanks again
Ferg

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> escribió
en el mensaje news:uz******** ******@TK2MSFTN GP04.phx.gbl...
In addition to needing NTFS permissions to the executables, the user
account executing the command needs permissions to run the command,
itself. Someone who is a GUEST, such as IUSR doesn't have the rights
in Windows to start and stop services. You could add your iusr account
to the admin group (not real advised) or run that page with a different
anonymous account that is an admin (a bit safer).

Ray at work

"ferg" <fgiletta@solso ft(punto)com(pu nto)ar> wrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
> People; i'm from argentina so , sorry, but my english isnīt good...
>
> Now, the question is; I'm trying to run a *.bat program on an ASP
> page, with the wsh script, but i canīt do it... because i obtain an
> error code (5 access denied)
> I let you the code that iīm using, so you can help me
>
> Dim wshell, proc set wshell = server.createob ject("wscript.s hell")
>
> prg="%comspec% /c net stop dns"
> set proc = wshell.exec(prg )
>
> Do While proc.Status < 1
>
> Loop
> Response.Write prg & "<br>"
> Response.Write proc.StdOut.Rea dAll & "<br>"
> Response.Write proc.stderr.rea dAll & "<br>"
> set wshell = nothing
>
> ....
>
> I tried besides, the "run" methon instead of "exec", but the result is
> the same...
> so ... help!!!
> I have gave permissons (total control) to IWAM and IUSR users on the
> page folder, and on cmd.exe program and net.exe program; but there
> isnīt case, it doesnīt work...
>
> Thanks for your suggestions; and sorry about my english... If you
> donīt understand my , let me knot that, and i try to explain better...
>
> Ferg
>
>




May 10 '06 #6
so, it doesnīt work for you?

I donīt know what iīm going to do about this...

I've try to set permissons to "cmd.exe" and "net.exe" to the user that I
have created, but ... it doesnīt work at all...

So... i'm tired; here in Argentina it's 19.00 o'clock, so i will try another
things tomorrow

thanks a lot. (... do you understand me ? or I write like an Indian...
jajaja)
Ferg

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> escribió en
el mensaje news:el******** ******@TK2MSFTN GP05.phx.gbl...
I'm experiencing that also. It must have to do with the act of starting
and stopping services, as when I change the command to:

prg="%comspec% /c net send %computername% test"

That executes fine.

I played around with various local security policies on my machine (XP Pro
SP2) and was unable to get it to execute.

Ray at work
"ferg" <fgiletta@solso ft(punto)com(pu nto)ar> wrote in message
news:u9******** ******@TK2MSFTN GP02.phx.gbl...
Thank you Ray; but it doesnīt work
it is still returning error 5, access denied...
I did everything you tell me, but it doesnīt work...
I donīt know what is going on...

Do you have any idea?...
Thank you again...
Ferg from Argentina

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> escribió
en el mensaje news:uG******** ******@TK2MSFTN GP04.phx.gbl...
It's a configuration in IIS. You can set this at a site, application,
or file level. To do it at the file level for example:

- Create a new local account on the machine called "testaccoun t" or
something along those lines.

- Add this account to the local administrators group on the machine

- in IIS, browse to the file with the code in question. Right click ---
Properties

- Go to the File Security tab

- Under "Anonymous access and authentication control" click the Edit...
button

- Make sure that Anonymous access is checked

- Change the account from IUSR_... to this new test account and enter
the password.

Ray at work

"ferg" <fgiletta@solso ft(punto)com(pu nto)ar> wrote in message
news:%2******** **********@TK2M SFTNGP04.phx.gb l...
Thank you Ray, but what do you mean when you say "...or run that page
with a different anonymous account that is an
admin (a bit safer)." . How can i run the page with a different
anonymous account ? ...

Thanks again
Ferg

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> escribió
en el mensaje news:uz******** ******@TK2MSFTN GP04.phx.gbl...
> In addition to needing NTFS permissions to the executables, the user
> account executing the command needs permissions to run the command,
> itself. Someone who is a GUEST, such as IUSR doesn't have the rights
> in Windows to start and stop services. You could add your iusr
> account to the admin group (not real advised) or run that page with a
> different anonymous account that is an admin (a bit safer).
>
> Ray at work
>
> "ferg" <fgiletta@solso ft(punto)com(pu nto)ar> wrote in message
> news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
>> People; i'm from argentina so , sorry, but my english isnīt good...
>>
>> Now, the question is; I'm trying to run a *.bat program on an ASP
>> page, with the wsh script, but i canīt do it... because i obtain an
>> error code (5 access denied)
>> I let you the code that iīm using, so you can help me
>>
>> Dim wshell, proc set wshell = server.createob ject("wscript.s hell")
>>
>> prg="%comspec% /c net stop dns"
>> set proc = wshell.exec(prg )
>>
>> Do While proc.Status < 1
>>
>> Loop
>> Response.Write prg & "<br>"
>> Response.Write proc.StdOut.Rea dAll & "<br>"
>> Response.Write proc.stderr.rea dAll & "<br>"
>> set wshell = nothing
>>
>> ....
>>
>> I tried besides, the "run" methon instead of "exec", but the result
>> is the same...
>> so ... help!!!
>> I have gave permissons (total control) to IWAM and IUSR users on the
>> page folder, and on cmd.exe program and net.exe program; but there
>> isnīt case, it doesnīt work...
>>
>> Thanks for your suggestions; and sorry about my english... If you
>> donīt understand my , let me knot that, and i try to explain
>> better...
>>
>> Ferg
>>
>>
>
>
>





May 10 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
24165
by: Bill | last post by:
I used to be able to run the following ASP code on our corp machine (W2K Server Edition and IIS-5) and successfully send a net-msg to anyone on our intranet. Last week it stopped working... and I'm not sure what changed. (I had applied ALL the W2K update patches... but... I'm not sure if the problem started before or after that.) Did any recent W2K patches change the way createObject, wScript.shell, or "NET SEND" works?
0
7150
by: Kyle | last post by:
To any who chose to provide an answer, or even any suggestions to this problem, I thank you greatly in advance. +200 pts. for any valid solutions. I am currently in the process of converting a website from an existing web host to our servers. This website used the WScript.Shell command to execute a series of Java commands that would send an encrypted email. I ran these commands directly on the server and they execute properly,
2
7538
by: bbxrider | last post by:
for win2k adv server/iis5.0 trying to run an external program from my asp routine that has multiple parameters, see following set shell = server.createobject("wscript.shell") shell.Run """f:\phsData\htmldoc\htmldoc.exe"" --webpage -f phsnew.pdf phsnew.htm" program either doesn't get invoked, or has an error, but since it has no error log i can't check that,
6
15654
by: MacKenzie | last post by:
The statement in an asp page: dim objShell Set objShell = WScript.CreateObject("WScript.Shell") now gives this error: VB err= 424,Object required If I use setobjShell=Server.CreateObject("WScript.Shell"), I get the error VB err= 5,Invalid procedure call or argument
2
12239
by: rcmail14872 | last post by:
I have seen some very general suggestions for alternative code to the WScript.Shell code, but nothing specific. In the two lines of code below (I think) the first line creates a text file on the hard drive. When I get to this line I get runtime error 429 "ActiveX component can't create object". I know I should not use WSH but I haven't been able to figure out an alternative. I tried looking through the VBA editor help file for "file"...
2
19287
by: Mike John | last post by:
I am trying to use the shell object to send keys to the explorer browser to run the send page funcion. I am receiving the above error only when I put my html file in the web server folder.However if I am runing the file local it will work Any reason, why when the file is in the web server folder the create object failed to created the shell object. Systax:
0
4625
by: AirYT | last post by:
Done a bunch of searching on this topic and i have come up with nothing. I have a .vbs script that i wish to execute by calling an asp page. i am working on a W2K server with IIS5.0 & SP4. My stopwebsite.vbs file is as follows: === On Error Resume Next
0
1347
by: arunpatil84 | last post by:
Hi , I am working on one ASP.NET application which zips the document files and allow the user to download the files. For that I am using Izarc command line freeware utility to zip the files. I am able to create zip the file from if the source files are in local machine as well as if the files to be zipp are in other machines from the network. My code is as follow as
2
10502
by: =?Utf-8?B?VG9kZA==?= | last post by:
Hello I'm using the following script to try and ping: <% Response.Buffer = true %> <% url = "www.espn.com" Set objWShell = CreateObject("WScript.Shell") Set objCmd = objWShell.Exec("ping " & url) strPResult = objCmd.StdOut.Readall() set objCmd = nothing: Set objWShell = nothing
2
10544
by: =?Utf-8?B?c3RldmV3YQ==?= | last post by:
Microsoft VBScript runtime error '800a0046' Permission denied ======================= Trying to find the solution is driving me crazy. Using IIS6 on Server2003 SBS Default website localhost IE7 browser running under administrator xp account login
0
10031
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...
0
11337
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10913
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10536
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8094
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
7246
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();...
1
4770
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
4336
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3355
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.