ContributionsMost RecentMost LikesSolutionsRe: I need to Start and Stop Window Services using Test complete J script? Thank you Helen, upgrading to Test Complete ver 12.40 fixed my issue. Re: I need to Start and Stop Window Services using Test complete J script? Yes. Re: I need to Start and Stop Window Services using Test complete J script? Thank you Helen for your quick reply but it did not work :( item.name did not return any value. Re: I need to Start and Stop Window Services using Test complete J script? Helen, Thank you for your help, I replaced my code with your suggestion and i bypassed the error but !eObjectsList.atEnd() always return true though objectsList.Count returns 150. Thus my script still failed. It cannot find the service that I sent. function fn_GetService(computerName, serviceName) { var wmiService, objectsList, eObjectsList, item, sysID; let Locator = Sys.OleObject("WbemScripting.SWbemLocator"); wmiService = Locator.ConnectServer(computerName, "\\root\\cimv2", "domain\\testUser", "testPass"); 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; } Re: I need to Start and Stop Window Services using Test complete J script? Hi ALex, Thank you. But I am using javascript, I found the sample jscript in TestComplete website but they don't work in javascript. That's why I switched to using the psservice approach. I don't mind which approach as long as it works in javascript. This issue is holding me up for weeks now :( I hope you can assist. I need to start the service remotely with credentials using javascript. I appreciate your help. Thank you so much, I tried adding - SWbemLocator.ConnectServer but failed as well. Can you Re: I need to Start and Stop Window Services using Test complete J script? I found a dos command that can stop & start the service. However it doesn't do anythign when i run it from Testcomplete belwo is what I did, but it didn't do anything. comExecute = "psservice \\\\" + serverName + " -u " + userName + " -p " + pWord + " " + command + " " + String.fromCharCode(34) + txtService + String.fromCharCode(34) Sys.OleObject("WScript.Shell").Exec("cmd /c " + comExecute) Re: I need to Start and Stop Window Services using Test complete J script? thank you trying it. Re: I need to Start and Stop Window Services using Test complete J script? I also need to pass on credentials. SO how can i use net stop to stop the service remotely with different credentials. Help please! Re: I need to Start and Stop Window Services using Test complete J script? By the way can i use net stop remotely? I tried entering the path but failed. I need to stop & start the service remotely. Can you help? Re: I need to Start and Stop Window Services using Test complete J script? Thank you Robert, let me try.