1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234
|
<html>
<head>
<title>ProcessMonitor.Hta</title>
<HTA:APPLICATION
ID="ProcessMonitor"
APPLICATIONNAME="ProcessMonitor"
SCROLL="no"
SINGLEINSTANCE="yes"
WINDOWSTATE="normal"
CAPTION="yes"
>
</head>
<style>
BODY
{
background-color: buttonface;
font-family: Helvetica;
font-size: 10pt;
margin-top: 10px;
margin-left: 20px;
margin-right: 20px;
margin-bottom: 10px;
}
#ListView1 {
font-size: 11px;
}
#ListView2 {
font-size: 11px;
}
.button
{
font-family: Helvetica;
font-size: 8pt;
}
</style>
<SCRIPT Language="VBScript">
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("Computers.txt", ForReading)
Sub Window_Onload
ListView1.font = "arial"
ListView1.View = 3
ListView1.GridLines = True
ListView1.ColumnHeaders.Add , , "Server Name", 130
ListView2.font = "arial"
ListView2.View = 3
ListView2.GridLines = True
ListView2.ColumnHeaders.Add , , "Name", 150
ListView2.ColumnHeaders.Add , , "Status", 90
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor")
For Each objItem in colItems
intHorizontal = objItem.ScreenWidth
intVertical = objItem.ScreenHeight
Next
XPos = 450
YPos = 410
intLeft = (intHorizontal - XPos) / 2
intTop = (intVertical - YPos) / 2
self.ResizeTo Xpos,YPos
window.moveTo intLeft, intTop
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
If strLine <> "" Then
Set itmx = ListView1.ListItems.Add(, ,strLine)
End If
Loop
End Sub
Sub ListView1_ColumnClick(ColumnHeader)
With ListView1
.Sorted = False
.SortKey = ColumnHeader.Index - 1
If .SortOrder = 0 Then
.SortOrder = 1
Else
.SortOrder = 0
End If
.Sorted = True
End With
End Sub
Sub ListView1_Click
strC = ListView1.SelectedItem.Text
ListView2.ListItems.Clear()
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=Impersonate}!\\" & strC & "\root\cimv2")
Set colServices = objWMIService.ExecQuery("Select * From Win32_Service")
For Each objService in colServices
Set itmY = ListView2.ListItems.Add(, ,objService.Name)
itmY.SubItems(1) = objService.State
Next
End sub
Sub ListView2_ColumnClick(ColumnHeader)
With ListView2
.Sorted = False
.SortKey = ColumnHeader.Index - 1
If .SortOrder = 0 Then
.SortOrder = 1
Else
.SortOrder = 0
End If
.Sorted = True
End With
End Sub
Sub Window_OnUnload
Quitter
End Sub
Sub Quitter
self.Close()
End sub
</SCRIPT>
<body bgcolor="buttonface">
<Big><Big><Big><ul><u>
<Center>
Service Monitor
</Big></Big></Big></ul></u>
</Center>
<table WIDTH="100%" BORDER=1>
<td valign="top" COLUMN=1>
<td width="130" height="220" style="border: 1px solid #C0C0C0">
<OBJECT ID="ListView1" WIDTH=130 HEIGHT=220 CLASSID="CLSID:BDD1F04B-858B-11D1-B16A-00C0F0283628">
<PARAM NAME="SortKey" VALUE="0">
<PARAM NAME="View" VALUE="3">
<PARAM NAME="Arrange" VALUE="0">
<PARAM NAME="LabelEdit" VALUE="1">
<PARAM NAME="SortOrder" VALUE="0">
<PARAM NAME="Sorted" VALUE="-1">
<PARAM NAME="MultiSelect" VALUE="0">
<PARAM NAME="LabelWrap" VALUE="-1">
<PARAM NAME="HideSelection" VALUE="0">
<PARAM NAME="HideColumnHeaders" VALUE="0">
<PARAM NAME="OLEDragMode" VALUE="0">
<PARAM NAME="OLEDropMode" VALUE="0">
<PARAM NAME="AllowReorder" VALUE="-1">
<PARAM NAME="Checkboxes" VALUE="0">
<PARAM NAME="FlatScrollBar" VALUE="0">
<PARAM NAME="FullRowSelect" VALUE="-1">
<PARAM NAME="GridLines" VALUE="-1">
<PARAM NAME="HotTracking" VALUE="0">
<PARAM NAME="HoverSelection" VALUE="0">
<PARAM NAME="PictureAlignment" VALUE="0">
<PARAM NAME="TextBackground" VALUE="0">
<PARAM NAME="ForeColor" VALUE="-2147483640">
<PARAM NAME="BackColor" VALUE="-2147483624">
<PARAM NAME="BorderStyle" VALUE="0">
<PARAM NAME="Appearance" VALUE="0">
<PARAM NAME="MousePointer" VALUE="0">
<PARAM NAME="Enabled" VALUE="1">
<PARAM NAME="NumItems" VALUE="0">
<param name="OLEDragMode" value="0">
<param name="OLEDropMode" value="0">
</OBJECT>
<td width="240" height="220" style="border: 1px solid #C0C0C0">
<OBJECT ID="ListView2" WIDTH=240 HEIGHT=220 CLASSID="CLSID:BDD1F04B-858B-11D1-B16A-00C0F0283628">
<PARAM NAME="SortKey" VALUE="0">
<PARAM NAME="View" VALUE="3">
<PARAM NAME="Arrange" VALUE="0">
<PARAM NAME="LabelEdit" VALUE="1">
<PARAM NAME="SortOrder" VALUE="0">
<PARAM NAME="Sorted" VALUE="-1">
<PARAM NAME="MultiSelect" VALUE="0">
<PARAM NAME="LabelWrap" VALUE="-1">
<PARAM NAME="HideSelection" VALUE="0">
<PARAM NAME="HideColumnHeaders" VALUE="0">
<PARAM NAME="OLEDragMode" VALUE="0">
<PARAM NAME="OLEDropMode" VALUE="0">
<PARAM NAME="AllowReorder" VALUE="-1">
<PARAM NAME="Checkboxes" VALUE="0">
<PARAM NAME="FlatScrollBar" VALUE="0">
<PARAM NAME="FullRowSelect" VALUE="-1">
<PARAM NAME="GridLines" VALUE="-1">
<PARAM NAME="HotTracking" VALUE="0">
<PARAM NAME="HoverSelection" VALUE="0">
<PARAM NAME="PictureAlignment" VALUE="0">
<PARAM NAME="TextBackground" VALUE="0">
<PARAM NAME="ForeColor" VALUE="-2147483640">
<PARAM NAME="BackColor" VALUE="-2147483624">
<PARAM NAME="BorderStyle" VALUE="0">
<PARAM NAME="Appearance" VALUE="0">
<PARAM NAME="MousePointer" VALUE="0">
<PARAM NAME="Enabled" VALUE="1">
<PARAM NAME="NumItems" VALUE="0">
<param name="OLEDragMode" value="0">
<param name="OLEDropMode" value="0">
</OBJECT>
</td>
</tr>
<table WIDTH="100%" BORDER=1>
<td VALIGN=TOP WIDTH="25%" COLSPAN=2>
<table BORDER=0>
</fieldset>
<center>
</table>
<fieldset>
<br>
<input id=Quitbutton class="button" type="button" value=" Quit " name="Quitter_Button" onClick="Quitter">
</center>
<br>
</fieldset>
</body>
</html> |
Partager