Running Net Stop

K

Ketta

I want to make a simple simple asp page. All I want is when the page loads
it does "net stop <service>". The code is below, it is not running as
IUSR_<machine>, I am authenticating as Administrator yet the service does
not stop. The blank page just loads with no errors and the service remains
running, what am I missing? I am completely new to ASP, I just want one
simple page for this purpose.

<HTML>
<TITLE>Test</TITLE>
<BODY>
<%
set wshell = server.createobject("wscript.shell")
wshell.run "net stop testservice"
set wshell = nothing
%>

</BODY>
</HTML>

Thank you
Ketta
 
K

Ketta

Well,
I guess it is still running as IUSR_ because I cannot even get a
directory output of C:\. How can I make this run as another user?

Thanks
 
A

Aaron Bertrand [MVP]

Place the ASP page in an application with anonymous disabled, and windows
auth enabled, then connect to the ASP page and authenticate using a
username/password on the machine/domain that has the ability to execute the
task(s)...
 
K

Ketta

Thanks, I tried that and still the service remains running. The command I
am issuing is correct, I have no idea. Thanks for the help though, it is
probably frustrating dealing with someone like myself who just wants one
small thing and cannot really contribute back to the community.
 
R

Ray at

I use this and it works fine. This is in an authenticated directory as
Aaron suggests.

Dim oShell
Set oShell = Server.CreateObject("WScript.Shell")
oShell.Run "cmd.exe /c net start winvnc", 0, True
Set oShell = Nothing

Ray at home
 
K

Ketta

If only that worked. There must be something horribly wrong with my access
control on that directory. It is so straight forward that the problem has
to be something silly. Thanks for the help.
 

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,778
Messages
2,569,605
Members
45,238
Latest member
Top CryptoPodcasts

Latest Threads

Top