M
MollocH
Hi NG,
Here some Code:
------------------------------------------------------
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim myPath As Management.ManagementPath = New Management.ManagementPath
myPath.Server = System.Environment.MachineName
myPath.NamespacePath = "root\CIMV2"
myPath.RelativePath = "Win32_Service.Name='Messenger'"
Dim myService As Management.ManagementObject = New
Management.ManagementObject(myPath)
Dim myvalue As String = "Testit"
MsgBox(myService.GetPropertyValue("DisplayName"))
myService.SetPropertyValue("DisplayName", myvalue)
myService.Put()
MsgBox(myService.GetPropertyValue("DisplayName"))
End Sub
End Class
-------------------------------------------------------
The first msgbox shows the initial value and the second shows the new value
.... but in services.msc nothing changes ...
have tried anything ... also can't bring the .invokemethod("change",args) to
work ...
Anyone an idea ?
Thx & greetings
Here some Code:
------------------------------------------------------
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim myPath As Management.ManagementPath = New Management.ManagementPath
myPath.Server = System.Environment.MachineName
myPath.NamespacePath = "root\CIMV2"
myPath.RelativePath = "Win32_Service.Name='Messenger'"
Dim myService As Management.ManagementObject = New
Management.ManagementObject(myPath)
Dim myvalue As String = "Testit"
MsgBox(myService.GetPropertyValue("DisplayName"))
myService.SetPropertyValue("DisplayName", myvalue)
myService.Put()
MsgBox(myService.GetPropertyValue("DisplayName"))
End Sub
End Class
-------------------------------------------------------
The first msgbox shows the initial value and the second shows the new value
.... but in services.msc nothing changes ...
have tried anything ... also can't bring the .invokemethod("change",args) to
work ...
Anyone an idea ?
Thx & greetings