Forum Discussion
Hi,
Does this article help? http://support.smartbear.com/viewarticle/9044/?SearchQuery=starting%2520windows%2520services&_ga=1.204611347.2019321854.1430989365
Regards,
Kevin
- VasanthVijay10 years agoContributor
Hello ,
I already refered this link.But same code i use and it not affect on the Services .
- AlexKaras10 years agoChampion Level 3
Hi,
-- Did you check in Task Manager that the relevant service process starts/stops?
-- Does the account that executes the start/stop code have anough privileges (as mentioned in the referenced article)?
-- Can you post here your actual code?
-- Any related messages in the Windows Event Viewer logs?
- CSL8 years agoContributor
I need to stop/start the service using javascript , I found this in testcomplete but it is using jscript. When I ran this I got an invalid parameter error. Can you help me convert this to javascript? I tried the suggestion in the thread as well to convert it somehow to javascript but got the not authorized error
function fn_GetService(computerName, serviceName)
{
var wmiService, objectsList, eObjectsList, item, sysID;
wmiService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\\\" +
computerName + "\\root\\cimv2");
objectsList = wmiService.InstancesOf("Win32_Service")
if (objectsList.Count > 0) {
eObjectsList = new Enumerator(objectsList);
for (; !eObjectsList.atEnd(); eObjectsList.moveNext()) {
item = eObjectsList.item();
if (item.Name == serviceName)
return item;
}
}
return null;
}
I appreciate your help. Thanks
Related Content
- 12 years ago
- 9 years ago
Recent Discussions
- 3 days ago
- 3 days ago
- 6 days ago