CCTV TECH
Nassau, Bahamas
Search this site Search Help
Default
Newest
Oldest
Your Ad here
All CCTV Pages
All Visual Basic
Real Estate in The Bahamas from $25,000
All Categories
Partners
 
 
 
Run Services
'// VBSCRIPT
Option Explicit

'// TEST FUNCTION - TURN OFF THEMES
If RunService("Themes", False) Then
    MsgBox "Themes Turned Off"
    '// TURN THEMES BACK ON
    If RunService("Themes", True) Then MsgBox ("Themes Back on")
Else
    MsgBox "Error"
End If

'// START OR STOP A WINDOWS SERVICE
Function RunService(Name, Enabled)
    Dim colServices, objService, ret
    On Error Resume Next
    Set colServices = GetObject("winmgmts:").ExecQuery _
        ("Select Name from Win32_Service where Name = '" & Name & "'")
    For Each objService In colServices
        If Enabled Then
            ret = objService.StartService()
        Else
            ret = objService.StopService()
        End If
    Next
    If ret = 0 Then
        RunService = True
    End If
End Function


CCTV | DVR | Video Surveillance | Day Night | CCTV Cameras | Remote Video | Tech Support | Software | Scripts | Visual Basic | Articles | Yellow Pages | Real Estate
Copyright © 2001/2012 BahamasSecurity.com
 
Website hosted in Nassau, The Bahamas