473,574 Members | 3,082 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 6518
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
24129
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...
0
7081
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...
2
7473
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...
6
15620
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
12192
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...
2
19270
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...
0
4601
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
1334
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...
2
10471
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
10517
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
7842
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...
0
8273
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...
1
7862
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...
0
8138
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...
0
6514
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5658
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...
0
3775
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...
0
3794
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1102
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...

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.