Code Script .co.uk

Home | Scripts | Tutorials | Disclaimer | Sitemap | Contact

   Computer Service Properties
 

Vbscript / Processes And Services / Computer Service Properties

Script to diplay a list of all computer services and their properties in Internet Explorer.


Set objExplorer = CreateObject("InternetExplorer.Application")
objExplorer.Navigate "about:blank"
objExplorer.ToolBar = 0
objExplorer.StatusBar = 1
objExplorer.Width = 800
objExplorer.Height = 570
objExplorer.Left = 0
objExplorer.Top = 0
objExplorer.Visible = 1

Do While (objExplorer.Busy)
Loop

Set objDocument = objExplorer.Document
objDocument.Open

objDocument.Writeln "<html><head><title>Service Status</title></head>"
objDocument.Writeln "<body bgcolor='white'>"

'Start data output
objDocument.Writeln "<table width='100%'>"


strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\" & strComputer& " ootcimv2")

Set colServices = objWMIService.ExecQuery _
    ("SELECT * FROM Win32_Service")

For Each objService in colServices
     objDocument.Writeln "<tr><pre>"
     objDocument.Writeln "<td>" & objService.DisplayName & "</td><pre>"
     objDocument.writeln "<td>" & objService.State & "</td><pre>"
 objDocument.writeln "<td>" & objService.StartMode & "</td><pre>"
 objDocument.writeln "<td>" & objService.Name & "</td><pre>"
 objDocument.writeln "<td>" & objService.PathName & "</td><pre>"
     objDocument.Writeln "</tr><pre>"
Next

objDocument.Writeln "</table>"

'End data output
 
objDocument.Writeln "</body></html>"
objDocument.Write()
objDocument.Close





Please note that a disclaimer applies to any code on this page.
 
   Actions
  Go Back
  Bookmark
  Print Page


   Menu
 
- Links
- Reference
- Script Editors
- Tutorials
- Vbscript
     - Active Directory
     - Exchange
     - Files And Folders
     - General
     - Ms Office
     - Operating System
     - Processes And Services
          - Computer Service Properties
          - End Process
          - Running Process Properties
          - Start Stop Service
     - Text Processing
     - User Interaction
     - Web Servers