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 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253
| <Html>
<Head>
<Title>PC Information + Process Killer © Hackoo Crackoo © 2013</Title>
<HTA:Application
Caption = Yes
Icon = "Explorer.exe"
Border = Thick
ShowInTaskBar = Yes
SingleInstance = Yes
MaximizeButton = Yes
MinimizeButton = Yes>
<META HTTP-EQUIV="MSThemeCompatible" CONTENT="YES">
<script Language = VBScript>
Option Explicit
Dim fso,Titre,LogFile
Titre = "PC Information + Process Killer © Hackoo Crackoo © 2013"
Set fso = CreateObject("Scripting.FileSystemObject")
LogFile = "ProcessKilled.txt"
If fso.FileExists(LogFile) Then fso.DeleteFile LogFile
'**********************************************************************************************
Sub Window_OnLoad
Dim intWidth,intHeight,strIPInfo,arrIPInfo
intWidth = 800
intHeight = 600
Me.ResizeTo intWidth, intHeight
Me.MoveTo ((Screen.Width / 2) - (intWidth / 2)),((Screen.Height / 2) - (intHeight / 2))
span_computername.innerHTML = GetComputerName()
span_username.innerHTML = GetUserName()
strIPInfo = GetIPInformation()
If InStr(strIPInfo, ";") > 0 Then
arrIPInfo = Split(strIPInfo, ";")
If UBound(arrIPInfo) >= 3 Then
span_ipaddress.InnerHTML = arrIPInfo(0)
span_subnetmask.InnerHTML = arrIPInfo(1)
span_defaultgateway.InnerHTML = arrIPInfo(2)
span_primarydns.InnerHTML = arrIPInfo(3)
If UBound(arrIPInfo) = 4 Then
span_secondarydns.InnerHTML = arrIPInfo(4)
End If
End If
End If
GenererCheckBox()
End Sub
'**********************************************************************************************
Function GetComputerName()
Dim objNetwork
Set objNetwork = CreateObject("WScript.Network")
GetComputerName = objNetwork.ComputerName
End Function
'**********************************************************************************************
Function GetUserName()
Dim objNetwork
Set objNetwork = CreateObject("WScript.Network")
GetUserName = objNetwork.UserName
End Function
'**********************************************************************************************
Function GetIPInformation()
Dim strComputer,objWMIService,colNetAdapters,strDetails,objAdapter
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=True")
strDetails = ""
For Each objAdapter In colNetAdapters
If IsNull(objAdapter.IPAddress) = False And IsNull(objAdapter.DefaultIPGateway) = False Then
If Join(objAdapter.IPAddress) <> "0.0.0.0" Then
If strDetails = "" Then
strDetails = Join(objAdapter.IPAddress) & ";"
strDetails = strDetails & Join(objAdapter.IPSubnet) & ";"
strDetails = strDetails & Join(objAdapter.DefaultIPGateway) & ";"
strDetails = strDetails & Join(objAdapter.DNSServerSearchOrder, ";")
End If
End If
End If
Next
GetIPInformation = strDetails
End Function
'**********************************************************************************************
Sub SelectAll()
Dim checkbox
For Each checkbox In CheckboxOption
checkbox.Checked = True
Next
End Sub
'**********************************************************************************************
Sub UnSelectAll()
Dim checkbox
For Each checkbox In CheckboxOption
checkbox.Checked = False
Next
End Sub
'**********************************************************************************************
Sub KillThis()
Dim LogFile,ws,fso,checkbox
LogFile = "ProcessKilled.txt"
Set Ws = CreateObject("Wscript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
For Each checkbox In CheckboxOption
If checkbox.Checked = True Then
Kill(checkbox.Value)
End If
Next
If FSO.FileExists(LogFile) Then
MsgBox Formater(LogFile),64,Titre
ws.run LogFile,1,True
End If
End Sub
'**********************************************************************************************
Sub Kill(Process)
Dim FSO,Ws,MyDate,Command,Execution,LogFile
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Ws = CreateObject("Wscript.Shell")
LogFile = "ProcessKilled.txt"
MyDate = "cmd /c echo %date% ^@ %time% >> "&LogFile&""
Command = "cmd /c Taskkill /F /IM "&Process&" >> "&LogFile&""
Execution = Ws.Run(MyDate,0,True)
Execution = Ws.Run(Command,0,True)
End Sub
'**********************************************************************************************
'Fonction pour formater et remplacer les caractères spéciaux unicode dans le LogFile
Function Formater(LogFile)
Dim fso,fRead,fWrite,Text
Set fso = CreateObject("Scripting.FileSystemObject")
Set fRead = fso.OpenTextFile(LogFile,1)
Text = fRead.ReadAll
fRead.Close
Set fWrite = fso.OpenTextFile(LogFile,2,True)
Text = Replace(Text,"","é")
Text = Replace(Text,"ے"," ")
Text = Replace(Text,"","ê")
Text = Replace(Text,"","ç")
Text = Replace(Text,"","ô")
Text = Replace(Text,"
","à")
Text = Replace(Text,"ٹ","è")
Text = Replace(Text,"","â")
Text = Replace(Text,"?"," ")
fWrite.WriteLine Text
Formater = Text
End Function
'**********************************************************************************************
'Fonction pour ajouter les doubles quotes dans une variable
Function DblQuote(strIn)
DblQuote = Chr(34) & strIn & Chr(34)
End Function
'**********************************************************************************************
Sub GenererCheckBox()
Const ForReading = 1
Dim StrHTML,objFSO,strNewFile,ListProcess,objFile,LireTout,MyTab,i
Set objFSO = CreateObject("Scripting.FileSystemObject")
StrHTML = "<h2><b><font color='red'>Processus à Arrêter</font></b></h2>"
strNewFile = "Process2Kill.txt"
If Not objFSO.FileExists(strNewFile) Then
ListProcess = "iexplore.exe" & vbCrLf & "FireFox.exe" & vbCrLf & "Chrome.exe" & vbCrLf &_
"outlook.exe" & vbCrLf & "winword.exe" & vbCrLf & "excel.exe" & vbCrLf & "searchindexer.exe" & vbCrLF & "searchprotocolhost.exe"
Call WriteProcessFile(ListProcess,strNewFile)
End If
Set objFile = objFSO.OpenTextFile(strNewFile,ForReading)
LireTout = objFile.ReadAll
MyTab = Split(LireTout,vbCrLf)
For i = LBound(MyTab) To UBound(MyTab)
StrHTML = StrHTML & MySpanCheckBox.InnerHTML &_
"<br><input type='checkbox' name='CheckboxOption' value=" & MyTab(i) & " title = " & MyTab(i) & " Checked = 'True'>" & MyTab(i)
Next
MySpanCheckBox.InnerHTML = StrHTML
End Sub
'**********************************************************************************************
'Fonction pour écrire les processus par défaut dans un fichier texte
Sub WriteProcessFile(strText,File)
Dim fs,ts
Const ForWriting = 2
Set fs = CreateObject("Scripting.FileSystemObject")
Set ts = fs.OpenTextFile(File,ForWriting,True)
ts.Write strText
ts.Close
End Sub
'**********************************************************************************************
</script>
<body text="white" style="background-color:DarkOrange">
<table width= "90%" border="0" align="center">
<tr>
<td align="center" colspan="2">
<h2>PC INFORMATION</h2><br>
</td>
</tr>
<tr>
<td>
Le Nom de l'ordinateur est :
</td>
<td>
<span id="span_computername"></span>
</td>
</tr>
<tr>
<td>
Vous êtes connecté en tant que :
</td>
<td>
<span id="span_username"></span>
</td>
</tr>
<tr>
<td>
Adresse IP est :
</td>
<td>
<span id="span_ipaddress"></span>
</td>
</tr>
<tr>
<td>
Le masque de sous-réseau est :
</td>
<td>
<span id="span_subnetmask"></span>
</td>
</tr>
<tr>
<td>
Passarelle par défaut est :
</td>
<td>
<span id="span_defaultgateway"></span>
</td>
</tr>
<tr>
<td>
Serveur DNS Primaire est :
</td>
<td>
<span id="span_primarydns"></span>
</td>
</tr>
<tr>
<td>
Serveur DNS Secondaire est :
</td>
<td>
<span id="span_secondarydns"></span>
</td>
</tr>
</table>
</body>
<center><input type="button" name="SelectAll" id="SelectAll" value="Tout sélectionner" onclick="SelectAll">
<input type="button" name="UnSelectAll" id="UnSelectAll" value="Tout désélectionner" onclick="UnSelectAll">
<input type="button" name="KillThis" id="KillThis" value="Arrêter le(s) Processus" onclick="KillThis()">
<table>
<tr>
<td>
<span id="MySpanCheckBox"></span>
</td>
</tr>
</table>
</html> |
Partager