|
it
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
wscript.shell error
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.createobject("wscript.shell") 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.ReadAll & "<br>" Response.Write proc.stderr.readAll & "<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 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 Show quote "ferg" <fgiletta@solsoft(punto)com(punto)ar> wrote in message news:%23u5qeaEdGHA.3348@TK2MSFTNGP03.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.createobject("wscript.shell") > > 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.ReadAll & "<br>" > Response.Write proc.stderr.readAll & "<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 > > 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 Show quote "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> escribió en el mensaje news:uzJcgmEdGHA.1324@TK2MSFTNGP04.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@solsoft(punto)com(punto)ar> wrote in message > news:%23u5qeaEdGHA.3348@TK2MSFTNGP03.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.createobject("wscript.shell") >> >> 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.ReadAll & "<br>" >> Response.Write proc.stderr.readAll & "<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 >> >> > > > 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 "testaccount" 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 Show quote "ferg" <fgiletta@solsoft(punto)com(punto)ar> wrote in message news:%23hq6%23RGdGHA.1324@TK2MSFTNGP04.phx.gbl... > 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:uzJcgmEdGHA.1324@TK2MSFTNGP04.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@solsoft(punto)com(punto)ar> wrote in message >> news:%23u5qeaEdGHA.3348@TK2MSFTNGP03.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.createobject("wscript.shell") >>> >>> 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.ReadAll & "<br>" >>> Response.Write proc.stderr.readAll & "<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 >>> >>> >> >> >> > > > 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 Show quote "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> escribió en el mensaje news:uGi9inGdGHA.1320@TK2MSFTNGP04.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 "testaccount" 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@solsoft(punto)com(punto)ar> wrote in message > news:%23hq6%23RGdGHA.1324@TK2MSFTNGP04.phx.gbl... >> 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:uzJcgmEdGHA.1324@TK2MSFTNGP04.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@solsoft(punto)com(punto)ar> wrote in message >>> news:%23u5qeaEdGHA.3348@TK2MSFTNGP03.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.createobject("wscript.shell") >>>> >>>> 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.ReadAll & "<br>" >>>> Response.Write proc.stderr.readAll & "<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 >>>> >>>> >>> >>> >>> >> >> >> > > > 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 Show quote "ferg" <fgiletta@solsoft(punto)com(punto)ar> wrote in message news:u9YPKCHdGHA.4900@TK2MSFTNGP02.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:uGi9inGdGHA.1320@TK2MSFTNGP04.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 "testaccount" 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@solsoft(punto)com(punto)ar> wrote in message >> news:%23hq6%23RGdGHA.1324@TK2MSFTNGP04.phx.gbl... >>> 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:uzJcgmEdGHA.1324@TK2MSFTNGP04.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@solsoft(punto)com(punto)ar> wrote in message >>>> news:%23u5qeaEdGHA.3348@TK2MSFTNGP03.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.createobject("wscript.shell") >>>>> >>>>> 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.ReadAll & "<br>" >>>>> Response.Write proc.stderr.readAll & "<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 >>>>> >>>>> >>>> >>>> >>>> >>> >>> >>> >> >> >> > > > 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 Show quote "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> escribió en el mensaje news:el2eqbHdGHA.4128@TK2MSFTNGP05.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@solsoft(punto)com(punto)ar> wrote in message > news:u9YPKCHdGHA.4900@TK2MSFTNGP02.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:uGi9inGdGHA.1320@TK2MSFTNGP04.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 "testaccount" 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@solsoft(punto)com(punto)ar> wrote in message >>> news:%23hq6%23RGdGHA.1324@TK2MSFTNGP04.phx.gbl... >>>> 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:uzJcgmEdGHA.1324@TK2MSFTNGP04.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@solsoft(punto)com(punto)ar> wrote in message >>>>> news:%23u5qeaEdGHA.3348@TK2MSFTNGP03.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.createobject("wscript.shell") >>>>>> >>>>>> 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.ReadAll & "<br>" >>>>>> Response.Write proc.stderr.readAll & "<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 >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> >>> >>> >>> >> >> >> > > > |
|||||||||||||||||||||||