if (oService.Started) then
REM we need to stop the service so it can pick up the registry changes
WScript.Echo "Stopping service so it can pick up changes"
returnCode = oService.StopService()
if (NOT returnCode = 0) then
WScript.Echo "Service stop error code: " & returnCode
stoppedCorrectly = FALSE
else
Counter = 6
do while (Counter > 0)
Counter = Counter - 1
returnCode = oService.InterrogateService()
if (returnCode = 6) then
REM
REM 6 means Service Not Active
REM
stoppedCorrectly = TRUE
exit do
elseif (NOT returnCode = 0) then
WScript.Echo "InterrogateService return code: " & returnCode
end if
WScript.Sleep(10000)
loop
if (stoppedCorrectly) then
WScript.Echo "Service stopped correctly"
else
WScript.Echo "Unable to stop Service in 60 seconds"
WScript.Echo "You should manually stop and start the AdtAgent service on the target machine"
end if
end if
end if
if (stoppedCorrectly) then
WScript.Echo "Starting service"
returnCode = oService.StartService()
if (NOT returnCode = 0) then
WScript.Echo "Service was not started correctly"
WScript.Echo "Service start error code: " & returnCode
else
WScript.Echo "Service started correctly"
end if
end if </Script></Contents>
</File>
</Files>
</WriteAction>
</MemberModules>
<Composition>
<Node ID="EnableACS"/>
</Composition>
</Composite>
</ModuleImplementation>
<InputType>System!System.BaseData</InputType>
</WriteActionModuleType>