(Ektron CMS,Microsoft Windows,Microsoft IIS,Microsoft ASP.NET)
by Jason Skowronek
on 09/25/2009
Anyone that develops on Ektron knows just how resource intensive the locally run Windows services can be. After manually stopping and starting all three of them every time I get on or pulled off a project, I decided to write a handy VBScript to start or stop ALL Ektron Windows Services with a single command.
Enjoy.
' Force explicit declaration of all variables.
Option Explicit
On Error Resume Next
dim arg, ArgNum, oArgs
dim WshShell
Set oArgs = WScript.Arguments
Set WshShell = WScript.CreateObject("WScript.Shell")
ArgNum = 0
While ArgNum < oArgs.Count
arg = LCase(oArgs(ArgNum))
Select Case arg
Case "-stop":
Call ServiceAction ("stop")
Case "-start":
Call ServiceAction ("start")
Case "-help","-?":
Call DisplayUsage
Case Else:
Call DisplayUsage
End Select
ArgNum = ArgNum + 1
Wend
Sub DisplayUsage
WScript.Echo "Usage: EktronServicesManager <-start|-stop>, [-help|-?]" & vbCrLf & _
"Example 1: EktronServicesManager -start"
WScript.Quit (1)
End Sub
Sub ServiceAction (action)
WshShell.Run "net " & action & " ""Ektron Extensibility Server""", 1
WshShell.Run "net " & action & " ""Ektron Async Processor""", 1
WshShell.Run "net " & action & " ""Ektron Windows Services 3.0""", 1
End Sub