Stop IIS Service

M

Max

I must stop IIS service from asp page.
I think that use a vbs file that execute from asp page :

asp page:
<%
set wshell = server.createobject("wscript.shell")
wshell.run "cscript d:\inetpub\wwwroot\stopservice.vbs",2,true
set wshell=nothing
%>

vbs :
strComputer = "localhost"
strService = "W3SVC"
Set oService = GetObject("WinMgmts:{impersonationLevel=impersonate}!//" &
strComputer & "/root/cimv2:Win32_Service.Name='" & strService & "'")
oService.StopService


But i have this error :
Errore di run-time di Microsoft VBScript (0x800A0046)
Permission denied
/ordini/test.asp, line 3


thanks
 
K

Ken Schaefer

You need to be an administrator to start/stop services. What user account is
running the web page?

Cheers
Ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,709
Latest member
AustinMudi

Latest Threads

Top