<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>