1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
Function GetAllStartUpCommands() As String
Dim s As New StringBuilder
Dim strComputer As String = "."
Dim objWMIService As Object = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Dim colStartupCommands As Object = objWMIService.ExecQuery _
("Select * from Win32_StartupCommand")
For Each objStartupCommand As Object In colStartupCommands
s.AppendLine("Command: " & objStartupCommand.Command)
s.AppendLine("Description: " & objStartupCommand.Description)
s.AppendLine("Location: " & objStartupCommand.Location)
s.AppendLine("Name: " & objStartupCommand.Name)
s.AppendLine("Setting ID: " & objStartupCommand.SettingID)
s.AppendLine("User: " & objStartupCommand.User)
s.AppendLine("")
Next
Return s.ToString
End Function
|