Discussion:
Command Button on webpage to restart service?
(too old to reply)
ikaikaokaina
2006-02-28 22:39:19 UTC
Permalink
Here's what I am trying to accomplish. We've got a service running on a
webserver that needs to occasionally restarted. Rather than bugging one of
us sys admins to restart the service, I was hoping to embed some vbscript
that will restart the service on that local system onto a webpage. That way,
when the application developer needs to restart the service, all he has to do
is go to the default .html page on http://localhost and click the command
button that runs the vbscript to restart the service.

I've successfully found the vbs code needed to restart the service, however
it doesn't appear to run when I embed it into the .html code. Are these type
of requests not able to be submitted via vbscript via HTML?
maximillianx
2006-02-28 23:10:02 UTC
Permalink
I don't have a ton of experience with this, but I believe you may have to do
something with client-side code. I don't think server-side will let you do
this.

Do you have a sample of code?

Rob
Post by ikaikaokaina
Here's what I am trying to accomplish. We've got a service running on a
webserver that needs to occasionally restarted. Rather than bugging one of
us sys admins to restart the service, I was hoping to embed some vbscript
that will restart the service on that local system onto a webpage. That way,
when the application developer needs to restart the service, all he has to do
is go to the default .html page on http://localhost and click the command
button that runs the vbscript to restart the service.
I've successfully found the vbs code needed to restart the service, however
it doesn't appear to run when I embed it into the .html code. Are these type
of requests not able to be submitted via vbscript via HTML?
ikaikaokaina
2006-03-02 23:08:29 UTC
Permalink
Thanks for the response. Yeah... here's my html code with the embedded
vbscript.

<html>
<head>
<title>* * Welcome to The Dev Server* *</title>
<script for="RestartRPC" language="VBScript">
<!--
Sub cmdRestartRPC_OnClick
Set objWinMgt = GetObject("winmgmts:")
Set objServiceName = objWinMgt.Get("Win32_Service.Name='NuGenesis RPC 6.0")

objServiceName.StopService()
objServiceName.StartService()
End Sub
-->
</script>
</head>
<body>
<p><font face="Tahoma" size="7">Development Server</font></p>
<p><font face="Tahoma" size="5">VMWare Instance VSD1-DEV Version
6.0.1.15</font></p>
<p><font face="Tahoma" size="5">The database server is VRTXSD02</font></p>
<p><font face="Tahoma" size="5">The database instance is nugnsdev</font></p>
<p> </p>
<p><font face="Tahoma" size="5">Go easy on this hardware. It is not a
dedicated server.</font></p>
<p> </p>
<p><font face="Tahoma" size="5">To launch DeVision, <a
href="/servlet/WebVisionServlet">click
here</a></font></p>
<p><font face="Arial Narrow" size="2">Or for the browser impaired,</font>
<font face="Arial Narrow"
size="2">http://vsd1-ndev.verbex.com/servlet/WebVisionServlet</font></p>
<p> </p>
<input type="button" value="Restart NuGen RPC" name="cmdRestartRPC"
event="onClick"><p>

</body>
</html>
I appreciate the help.
Post by maximillianx
I don't have a ton of experience with this, but I believe you may have to do
something with client-side code. I don't think server-side will let you do
this.
Do you have a sample of code?
Rob
Post by ikaikaokaina
Here's what I am trying to accomplish. We've got a service running on a
webserver that needs to occasionally restarted. Rather than bugging one of
us sys admins to restart the service, I was hoping to embed some vbscript
that will restart the service on that local system onto a webpage. That way,
when the application developer needs to restart the service, all he has to do
is go to the default .html page on http://localhost and click the command
button that runs the vbscript to restart the service.
I've successfully found the vbs code needed to restart the service, however
it doesn't appear to run when I embed it into the .html code. Are these type
of requests not able to be submitted via vbscript via HTML?
Continue reading on narkive:
Loading...