Forum Discussion

rgareme's avatar
rgareme
Occasional Contributor
11 years ago

Disable a windows service from a TestComplete script

How can i disable a windows service from a TestComplete script?



I have found an smartbear link in which there are an script for start and stop a windows service, but what i need is an script to disable a service.
  • var sServiceName = 'myServiceName'



    var sCmd = 'sc config ' + sServiceName + ' start= disabled'



    var wshShell = Sys.OleObject ('WScrit.Shell')



    wshShell.Exec (sCmd)
  • gibi's avatar
    gibi
    New Contributor
    var sServiceName = 'myServiceName'



    var sCmd = 'sc config ' + sServiceName + ' start= disabled'



    var wshShell = Sys.OleObject ('WScrit.Shell')



    wshShell.Exec (sCmd)