Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Check for services name and status

1 view
Skip to first unread message

Matej

unread,
Mar 8, 2003, 9:43:15 AM3/8/03
to
Hello,

I have created small .vbs script for listing all services and
services status, but this script doesn`t work on Win NT.
(On Win2K and WinXP is running OK).

script:

Dim objComputer, clsService
Set objComputer=GetObject("WinNT://domain/computer,computer")
objComputer.Filter=Array("service")
For Each clsService in objComputer
Wscript.Echo clsService.Name & " status: " & clsService.Status
Next

I hope that anyone can help me with this.

Regards,
Matej

Greg Woolley

unread,
Mar 8, 2003, 11:01:30 AM3/8/03
to
Hello,

none of the Internet Explorer events are working, can you show me how to do
this correctly, thank you!

Set ie = WScript.CreateObject("InternetExplorer.Application", "ie_")

ie.Navigate "http://www.google.com"
ie.Visible = 1
ie.Left = 0
ie.Top = 0
ie.Height = 600
ie.Width = 800
ie.ToolBar = 1
ie.StatusBar = 1
ie.Resizable = 1
ie.StatusBar = 1

Private Sub ie_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp Is ie.Object) Then
MsgBox "your document is ready"
End If
End Sub

Private Sub ie_Stop()
MsgBox "IE has stopped"
End Sub

Private Sub ie_Quit()
MsgBox "User has quit"
End Sub

Private Sub ie_Refresh()
MsgBox "Your document has refreshed"
End Sub
-------------------

Also tried adding

WScript.ConnectObject ie,"ie_"

yet that gives an error.

Regards,

Greg Woolley


Torgeir Bakken (MVP)

unread,
Mar 8, 2003, 8:29:42 PM3/8/03
to

Multipost; response in microsoft.public.scripting.vbscript


Multiposting vs Crossposting
http://www.blakjak.demon.co.uk/mul_crss.htm


--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter


Torgeir Bakken (MVP)

unread,
Mar 8, 2003, 8:33:09 PM3/8/03
to
Matej wrote:

Hi

You need to install ADSI (DSClient) on your NT 4.0 computer:
http://www.microsoft.com/windows2000/server/evaluation/news/bulletins/adextension.asp

Matej

unread,
Mar 10, 2003, 3:05:02 AM3/10/03
to
"Torgeir Bakken (MVP)" <Torgeir.B...@hydro.com> wrote in message news:<3E6A99D5...@hydro.com>...

Thanks for Resolution. ;)

Matej

unread,
Mar 10, 2003, 3:24:48 AM3/10/03
to
"Torgeir Bakken (MVP)" <Torgeir.B...@hydro.com> wrote in message news:<3E6A99D5...@hydro.com>...

Hello,
Now It`s working, but is there any other way to list services,
because I want to use this script as part of MSI package and if
end-user does not have installed DSClient installation would fail.
(so I need something else to check SQL service) Is there any other
way?


Regards,
Matej

Torgeir Bakken (MVP)

unread,
Mar 10, 2003, 4:15:35 PM3/10/03
to
Matej wrote:

> "Torgeir Bakken (MVP)" <Torgeir.B...@hydro.com> wrote in message news:<3E6A99D5...@hydro.com>...
>
> Hello,
> Now It`s working, but is there any other way to list services,
> because I want to use this script as part of MSI package and if
> end-user does not have installed DSClient installation would fail.
> (so I need something else to check SQL service) Is there any other
> way?

Hi

On a NT 4 computer, if you need to just check if the service is existing and not disabled (not caring if the
service is running or stopped), something like this can be used:


Set oShell = CreateObject("WScript.Shell")

On Error Resume Next
iValue = oShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Services\Messenger\Start")
On Error Goto 0

If iValue = 2 Or iValue = 3 Then
WScript.Echo "The Messenger service exists and is not disabled"
End If


If Start is 2, the service is set to Automatic, if it is 3, it is set to Manual.

Matej

unread,
Mar 11, 2003, 3:26:10 AM3/11/03
to
"Torgeir Bakken (MVP)" <Torgeir.B...@hydro.com> wrote in message news:<3E6D007...@hydro.com>...

Thanks, I`ll try.

0 new messages