Forum Discussion
- k_de_boer03Contributor
Hi,
Does this article help? http://support.smartbear.com/viewarticle/9044/?SearchQuery=starting%2520windows%2520services&_ga=1.204611347.2019321854.1430989365Regards,
Kevin- VasanthVijayContributor
Hello ,
I already refered this link.But same code i use and it not affect on the Services .
- AlexKarasChampion 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?
- AlexKarasChampion Level 3
Hi Vasanth,
You may either execute 'net start/stop' command using WScript.Run() or do this via WMI (google for something like "WMI stop windows service").
You may also search this forum - there were a couple of samples here on how to do this using WMI.
- m_essaidValued Contributor
hi,
I just scripted that a few days ago :
procedure xxxx
var
wmiService, service;
begin
wmiService:= WMI.Service;
service:= wmiService.Get('Win32_Service.Name=''theServiceName''');
service.StartServiceplease note that "theServiceName" is to be changed by the service name as it appears in windows services
also, "service.StopService" stops the service
finally, both return an integer. 0 indicates that the operation has correctly been processed.
see this page for all return codes :
https://msdn.microsoft.com/en-us/library/aa393660(v=vs.85).aspx
Related Content
- 7 years ago
- 3 years ago
Recent Discussions
- 3 days ago
- 3 days ago
- 6 days ago