Thursday, 22 August 2013

How to start windows service through VB Script?

How to start windows service through VB Script?

How to start windows service through VB Script?
I tried following code to start Mysql service
test.vbs:
service="bthserv"
Set wmi = GetObject("winmgmts://./root/cimv2")
qry = "SELECT * FROM Win32_Service WHERE Name='" & service & "'"
For Each s In wmi.ExecQuery(qry)
s.StartService
Next
But this code not starts the mysql service.

No comments:

Post a Comment