Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <Constants.au3>
#include <EditConstants.au3>
#include <GuiButton.au3>
#include <GUIConstantsEx.au3>
#include <Inet.au3>
#include <WindowsConstants.au3>
#RequireAdmin
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\..\Downloads\Logitech-G7-Corrdless-2.ico
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs ----------------------------------------------------------------------------
AutoIt Version : 3.3.8.1
Auteur: Amesam-ToolsDiags
#ce ----------
#include-once
Global $font = "Comic Sans MS"
Global $font1 = "segoe print"
Global $font2 = "Segoe Script"
Global $hosts = @SystemDir & "\drivers\etc\hosts"
Global $Now = @MDAY & "/" & @MON & "/" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC
Global $obj_SR, $obj_WMI
Global $SystemDrive = EnvGet('SystemDrive') & '\'
Local $sUserName = "Administrateur"
Local $sPassword = "P@ssw0rd"
If not IsAdmin() Then
RunAs($sUserName, @ComputerName, $sPassword, 0, @ScriptFullPath, @ScriptDir)
Exit
EndIf
#Region ### START Koda GUI section ### Form=C:\Users\63\Desktop\form4.kxf
Global $Form1 = GUICreate("ToolsDiags - Amesam", 915/1680*@DesktopWidth, 730/1050*@DesktopHeight, 190/1680*@DesktopWidth, 125/1050*@DesktopHeight)
GUICtrlSetBkColor($Form1, 0xFFFFFF)
$Input1 = GUICtrlCreateInput("cmd.exe /C echo.&", 13/1680*@DesktopWidth, 648/1050*@DesktopHeight, 161/1680*@DesktopWidth, 5/1050*@DesktopHeight)
GUICtrlSetBkColor($Input1, 0xFF0000)
GUICtrlSetState(-1, $GUI_DISABLE)
Global $Edit1 = GUICtrlCreateEdit("", 200/1680*@DesktopWidth, 672/1050*@DesktopHeight, 417/1680*@DesktopWidth, 49/1050*@DesktopHeight, BitOR($GUI_SS_DEFAULT_EDIT,$WS_BORDER), BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))
GUICtrlSetBkColor($Edit1, 0xFFFFCC)
GUICtrlSetColor($Edit1,0x0000FF)
Global $Edit2 = GUICtrlCreateEdit("", 200/1680*@DesktopWidth, 192/1050*@DesktopHeight, 417/1680*@DesktopWidth, 473/1050*@DesktopHeight, BitOR($GUI_SS_DEFAULT_EDIT,$WS_BORDER), BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))
GUICtrlSetData(-1, "")
GUICtrlSetBkColor($Edit2, 0xFFFFCC)
GUICtrlSetCursor (-1, 0)
Global $Pic1 = GUICtrlCreatePic("C:\Users\63\Desktop\Images\bfee7d1895f445777160322afc7e3c99.jpg", 8/1680*@DesktopWidth, 8/1050*@DesktopHeight, 169/1680*@DesktopWidth, 169/1050*@DesktopHeight)
Global $Pic2 = GUICtrlCreatePic("C:\Users\63\Desktop\Images\malwares-troyanos.jpg", 664/1680*@DesktopWidth, 264/1050*@DesktopHeight, 201/1680*@DesktopWidth, 153/1050*@DesktopHeight)
Global $Graphic1 = GUICtrlCreateGraphic(184/1680*@DesktopWidth, 0/1050*@DesktopHeight, 18/1680*@DesktopWidth, 169/1050*@DesktopHeight)
GUICtrlSetGraphic(-1, $GUI_GR_PENSIZE, 3)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xFF0000, 0xFFFF00)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 7, 6)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 7, 154)
Global $Graphic2 = GUICtrlCreateGraphic(200/1680*@DesktopWidth, 176/1050*@DesktopHeight, 401/1680*@DesktopWidth, 12/1050*@DesktopHeight)
GUICtrlSetGraphic(-1, $GUI_GR_PENSIZE, 3)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xFF0000)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, 1)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 396, 1)
Global $Graphic3 = GUICtrlCreateGraphic(184/1680*@DesktopWidth, 192/1050*@DesktopHeight, 17/1680*@DesktopWidth, 479/1050*@DesktopHeight)
GUICtrlSetGraphic(-1, $GUI_GR_PENSIZE, 3)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xFF0000)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 8, 8)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 8, 482)
Global $Graphic4 = GUICtrlCreateGraphic(624/1680*@DesktopWidth, 200/1050*@DesktopHeight, 284/1680*@DesktopWidth, 8/1050*@DesktopHeight)
GUICtrlSetGraphic(-1, $GUI_GR_PENSIZE, 2)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xFF0000)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 6, 2)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 279, 2)
Global $Graphic5 = GUICtrlCreateGraphic(624/1680*@DesktopWidth, 128/1050*@DesktopHeight, 286/1680*@DesktopWidth, 8/1050*@DesktopHeight)
GUICtrlSetGraphic(-1, $GUI_GR_PENSIZE, 2)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xFF0000)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 8, 2)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 281, 2)
Global $Input2 = GUICtrlCreateInput("" & MemGetStats (), 752/1680*@DesktopWidth, 48/1050*@DesktopHeight, 155/1680*@DesktopWidth, 20/1050*@DesktopHeight) ; Memo total ****Affichage ????****
GUICtrlSetBkColor($Input2, 0xFFFFCC)
GUICtrlSetState(-1, $GUI_DISABLE)
Global $Input3_IpAddress = GUICtrlCreateInput("" & @IPAddress1, 408/1680*@DesktopWidth, 8/1050*@DesktopHeight, 201/1680*@DesktopWidth, 19/1050*@DesktopHeight)
GUICtrlSetBkColor($Input3_IpAddress, 0xFFFFCC)
GUICtrlSetState(-1, $GUI_DISABLE)
Global $Input4_IpAddress = GUICtrlCreateInput("" & _GetIP(), 408/1680*@DesktopWidth, 32/1050*@DesktopHeight, 201, 19)
GUICtrlSetBkColor($Input4_IpAddress, 0xFFFFCC)
GUICtrlSetState(-1, $GUI_DISABLE)
Global $Input5 = GUICtrlCreateInput("" & "CPU " & @CPUARCH & " OS " & @OSARCH &" "& @OSVersion, 408/1680*@DesktopWidth, 56/1050*@DesktopHeight, 201/1680*@DesktopWidth, 19/1050*@DesktopHeight)
GUICtrlSetBkColor($Input5, 0xFFFFCC)
GUICtrlSetState(-1, $GUI_DISABLE)
Global $Input6 = GUICtrlCreateInput("Input6", 752/1680*@DesktopWidth, 72/1050*@DesktopHeight, 155/1680*@DesktopWidth, 20/1050*@DesktopHeight) ; % utilisation
GUICtrlSetBkColor($Input6, 0xFFFFCC)
GUICtrlSetState(-1, $GUI_DISABLE)
Global $Input7 = GUICtrlCreateInput("Input7", 752/1680*@DesktopWidth, 96/1050*@DesktopHeight, 155/1680*@DesktopWidth, 20/1050*@DesktopHeight) ; Memo disponible
GUICtrlSetBkColor($Input7, 0xFFFFCC)
GUICtrlSetState(-1, $GUI_DISABLE)
Global $Input8 = GUICtrlCreateInput("Input8", 752/1680*@DesktopWidth, 144/1050*@DesktopHeight, 155/1680*@DesktopWidth, 20/1050*@DesktopHeight); Pagefile total ****Affichage ????****
GUICtrlSetBkColor($Input8, 0xFFFFCC)
GUICtrlSetState(-1, $GUI_DISABLE)
Global $Input9 = GUICtrlCreateInput("Input9", 752/1680*@DesktopWidth, 168/1050*@DesktopHeight, 155/1680*@DesktopWidth, 20/1050*@DesktopHeight) ; Pagefile disponible
GUICtrlSetBkColor($Input9, 0xFFFFCC)
GUICtrlSetState(-1, $GUI_DISABLE)
Global $Input10 = GUICtrlCreateInput("Input10", 752/1680*@DesktopWidth, 216/1050*@DesktopHeight, 155/1680*@DesktopWidth, 20/1050*@DesktopHeight) ; Virtuelle total ****Affichage ????****
GUICtrlSetBkColor($Input10, 0xFFFFCC)
GUICtrlSetState(-1, $GUI_DISABLE)
Global $Input11 = GUICtrlCreateInput("Input11", 752/1680*@DesktopWidth, 240/1050*@DesktopHeight, 155/1680*@DesktopWidth, 20/1050*@DesktopHeight) ; Virtuelle disponible
GUICtrlSetBkColor($Input11, 0xFFFFCC)
GUICtrlSetState(-1, $GUI_DISABLE)
Global $Progress1 = GUICtrlCreateProgress(632/1680*@DesktopWidth, 80/1050*@DesktopHeight, 102/1680*@DesktopWidth, 9/1050*@DesktopHeight)
Global $Progress2 = GUICtrlCreateProgress(632/1680*@DesktopWidth, 104/1050*@DesktopHeight, 102/1680*@DesktopWidth, 9/1050*@DesktopHeight)
Global $Progress3 = GUICtrlCreateProgress(632/1680*@DesktopWidth, 176/1050*@DesktopHeight, 102/1680*@DesktopWidth, 9/1050*@DesktopHeight)
Global $Progress4 = GUICtrlCreateProgress(632/1680*@DesktopWidth, 244/1050*@DesktopHeight, 102/1680*@DesktopWidth, 9/1050*@DesktopHeight)
Global $Label1 = GUICtrlCreateLabel("Pagefile total", 630/1680*@DesktopWidth, 144/1050*@DesktopHeight, 100/1680*@DesktopWidth, 17/1050*@DesktopHeight)
GUICtrlSetFont(-1, 9, 400, 2, $font)
GUICtrlSetColor($Label1,0x0000FF)
Global $Label2 = GUICtrlCreateLabel("Votre IP Local", 208/1680*@DesktopWidth, 8/1050*@DesktopHeight, 156/1680*@DesktopWidth, 17/1050*@DesktopHeight)
GUICtrlSetFont(-1, 10, 400, 2, $font)
GUICtrlSetColor($Label2,0x0000FF)
Global $Label3 = GUICtrlCreateLabel("Votre IP Publique", 208/1680*@DesktopWidth, 32/1050*@DesktopHeight, 156/1680*@DesktopWidth, 17/1050*@DesktopHeight)
GUICtrlSetFont(-1, 10, 400, 2, $font)
GUICtrlSetColor($Label3,0x0000FF)
Global $Label4 = GUICtrlCreateLabel("Votre CPU et OS", 208/1680*@DesktopWidth, 56/1050*@DesktopHeight, 156/1680*@DesktopWidth, 17/1050*@DesktopHeight)
GUICtrlSetFont(-1, 10, 400, 2, $font)
GUICtrlSetColor($Label4,0x0000FF)
Global $Label5 = GUICtrlCreateLabel("Physique -RAM-", 630/1680*@DesktopWidth, 48/1050*@DesktopHeight, 100/1680*@DesktopWidth, 17/1050*@DesktopHeight)
GUICtrlSetFont(-1, 10, 400, 2, $font)
GUICtrlSetColor($Label5,0x0000FF)
Global $Label6 = GUICtrlCreateLabel("virtuelle total", 630/1680*@DesktopWidth, 216/1050*@DesktopHeight, 100/1680*@DesktopWidth, 17/1050*@DesktopHeight)
GUICtrlSetFont(-1, 9, 400, 2, $font)
GUICtrlSetColor($Label6,0x0000FF)
Global $Label7 = GUICtrlCreateLabel("Activités de la mémoire", 680/1680*@DesktopWidth, 8/1050*@DesktopHeight, 228/1680*@DesktopWidth, 19/1050*@DesktopHeight)
GUICtrlSetFont(-1, 12, 400, 2, $font)
GUICtrlSetColor($Label7,0x0000FF)
Global $Button1 = GUICtrlCreateButton("Rapport général", 14/1680*@DesktopWidth, 600/1050*@DesktopHeight, 161/1680*@DesktopWidth, 42/1050*@DesktopHeight, BitOR($BS_COMMANDLINK, $BS_DEFCOMMANDLINK))
Global $Button2 = GUICtrlCreateButton("Informations système", 14/1680*@DesktopWidth, 200/1050*@DesktopHeight, 161/1680*@DesktopWidth, 33/1050*@DesktopHeight)
GUICtrlSetFont(-1, 9, 400, 2, $font)
Global $Button3 = GUICtrlCreateButton("Configuration de l'IP", 14/1680*@DesktopWidth, 240/1050*@DesktopHeight, 161/1680*@DesktopWidth, 33/1050*@DesktopHeight)
GUICtrlSetFont(-1, 9, 400, 2, $font)
Global $Button4 = GUICtrlCreateButton("Afficher les TEMP\Cookies", 14/1680*@DesktopWidth, 280/1050*@DesktopHeight, 161/1680*@DesktopWidth, 33/1050*@DesktopHeight)
GUICtrlSetFont(-1, 9, 400, 2, $font)
Global $Button5 = GUICtrlCreateButton("Programmes et Run", 14/1680*@DesktopWidth, 320/1050*@DesktopHeight, 161/1680*@DesktopWidth, 33/1050*@DesktopHeight)
GUICtrlSetFont(-1, 9, 400, 2, $font)
Global $Button6 = GUICtrlCreateButton("Afficher System32", 14/1680*@DesktopWidth, 360/1050*@DesktopHeight, 161/1680*@DesktopWidth, 33/1050*@DesktopHeight)
GUICtrlSetFont(-1, 9, 400, 2, $font)
Global $Button7 = GUICtrlCreateButton("Afficher les drivers", 14/1680*@DesktopWidth, 400/1050*@DesktopHeight, 161/1680*@DesktopWidth, 33/1050*@DesktopHeight)
GUICtrlSetFont(-1, 9, 400, 2, $font)
Global $Button8 = GUICtrlCreateButton("Tâches/Services exécutés", 14/1680*@DesktopWidth, 440/1050*@DesktopHeight, 161/1680*@DesktopWidth, 33/1050*@DesktopHeight)
GUICtrlSetFont(-1, 9, 400, 2, $font)
Global $Button9 = GUICtrlCreateButton("Ports ouverts", 14/1680*@DesktopWidth, 480/1050*@DesktopHeight, 161/1680*@DesktopWidth, 33/1050*@DesktopHeight)
GUICtrlSetFont(-1, 9, 400, 2, $font)
Global $Button10 = GUICtrlCreateButton("Statistiques connexions/IP", 14/1680*@DesktopWidth, 520/1050*@DesktopHeight, 161/1680*@DesktopWidth, 33/1050*@DesktopHeight)
GUICtrlSetFont(-1, 9, 400, 2, $font)
Global $Button11 = GUICtrlCreateButton("Options Menu Clic Droit", 14/1680*@DesktopWidth, 660/1050*@DesktopHeight, 161/1680*@DesktopWidth, 49/1050*@DesktopHeight)
GUICtrlSetFont(-1, 9, 400, 2, $font)
Global $Button12 = GUICtrlCreateButton("SFC /Scannow", 14/1680*@DesktopWidth, 560/1050*@DesktopHeight, 161/1680*@DesktopWidth, 33/1050*@DesktopHeight)
GUICtrlSetFont(-1, 9, 400, 2, $font)
Global $Button13 = GUICtrlCreateButton(" Clean hosts avec ToolsDiags ", 408/1680*@DesktopWidth, 80/1050*@DesktopHeight, 201/1680*@DesktopWidth, 25/1050*@DesktopHeight, $BS_LEFT)
_GUICtrlButton_SetShield($button13)
GUICtrlSetFont(-1, 9, 400, 2, $font)
Global $Button14 = GUICtrlCreateButton(" Modifier le fichier hosts", 208/1680*@DesktopWidth, 112/1050*@DesktopHeight, 193/1680*@DesktopWidth, 25/1050*@DesktopHeight, $BS_LEFT)
_GUICtrlButton_SetShield($button14)
GUICtrlSetFont(-1, 9, 400, 2, $font)
Global $Button15 = GUICtrlCreateButton(" Quitter", 640/1680*@DesktopWidth, 664/1050*@DesktopHeight, 257/1680*@DesktopWidth, 57/1050*@DesktopHeight, -1, BitOR($BS_COMMANDLINK, $BS_DEFCOMMANDLINK))
GUICtrlSetFont(-1, 12, 400, 2, $font)
GUICtrlSetBkColor($Button15, 0xCCFFFF)
Global $Button16 = GUICtrlCreateButton(" Visionner le fichier hosts", 208/1680*@DesktopWidth, 80/1050*@DesktopHeight, 193/1680*@DesktopWidth, 25/1050*@DesktopHeight, $BS_LEFT)
_GUICtrlButton_SetShield($button16)
GUICtrlSetFont(-1, 9, 400, 2, $font)
Global $Button19 = GUICtrlCreateButton(" Nettoyage général de l'ordinateur ", 632/1680*@DesktopWidth, 424/1050*@DesktopHeight, 273/1680*@DesktopWidth, 33/1050*@DesktopHeight, $BS_LEFT)
_GUICtrlButton_SetShield ($button19)
GUICtrlSetFont(-1, 9, 400, 2, $font)
Global $Button20 = GUICtrlCreateButton(" Supprimer le points de restauration ", 632/1680*@DesktopWidth, 464/1050*@DesktopHeight, 273/1680*@DesktopWidth, 33/1050*@DesktopHeight, $BS_LEFT)
_GUICtrlButton_SetShield($button20)
GUICtrlSetFont(-1, 9, 400, 2, $font)
Global $Button21 = GUICtrlCreateButton(" Création d'un point de restauration ", 632/1680*@DesktopWidth, 504/1050*@DesktopHeight, 273/1680*@DesktopWidth, 33/1050*@DesktopHeight, $BS_LEFT)
_GUICtrlButton_SetShield($button21)
GUICtrlSetFont(-1, 9, 400, 2, $font)
Global $Button22 = GUICtrlCreateButton(" Gestion du volume des sauvgardes", 632/1680*@DesktopWidth, 544/1050*@DesktopHeight, 273/1680*@DesktopWidth, 33/1050*@DesktopHeight, $BS_LEFT)
_GUICtrlButton_SetShield($button22)
GUICtrlSetFont(-1, 9, 400, 2, $font)
Global $Button23 = GUICtrlCreateButton("Désactiver l'autorun par défaut dans Windows", 632/1680*@DesktopWidth, 584/1050*@DesktopHeight, 273/1680*@DesktopWidth, 33/1050*@DesktopHeight)
; _GUICtrlButton_SetShield($button23)
GUICtrlSetFont(-1, 9, 400, 2, $font)
Global $Button24 = GUICtrlCreateButton("Redémarrer pour valider les modifications", 632/1680*@DesktopWidth, 624/1050*@DesktopHeight, 273/1680*@DesktopWidth, 33/1050*@DesktopHeight)
;_GUICtrlButton_SetShield($button24)
GUICtrlSetFont(-1, 9, 400, 2, $font)
Global $Button25 = GUICtrlCreateButton("Copier le résultat de la commande ", 208/1680*@DesktopWidth, 144/1050*@DesktopHeight, 401/1680*@DesktopWidth, 25/1050*@DesktopHeight)
GUICtrlSetBkColor($Button25, 0xFFCC00)
GUICtrlSetFont(-1, 9, 400, 2, $font2)
Global $Button26 = GUICtrlCreateButton(" Restaurer le hosts à l'origine ", 408/1680*@DesktopWidth, 112/1050*@DesktopHeight, 201/1680*@DesktopWidth, 25/1050*@DesktopHeight, $BS_LEFT)
_GUICtrlButton_SetShield($button26)
GUICtrlSetFont(-1, 9, 400, 2, $font)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
while 1
#cs##############################################
Valeur de retour
Retourne un tableau de sept éléments contenant les informations sur la mémoire:
$ Array [0] = Charge Memory (pourcentage de mémoire utilisée)
$ Array [1] = RAM physique totale
$ Array [2] = RAM physique disponible
$ Array [3] = Pagefile totale
$ Array [4] = Pagefile Disponible
$ Array [5] = Total virtuelle
$ Array [6] = Disponible virtuelle
Toutes les tailles de mémoire sont en kilo-octets.
#ce##############################################
$memo = MemGetStats()
$Label1 = $memo[1]
$memo2 = $memo[0]
$memo3 = $memo[2]
$Label5 = $memo[3]
$memo5 = $memo[4]
$Label6 = $memo[5]
$memo7 = $memo[6]
Switch $memo2
Case 0 To 100
$st = StringRight($memo2, 2)
$st1 = StringRight($memo3, 2)
$st2 = StringRight($memo5, 2)
$st3 = StringRight($memo7, 2)
$Mem = MemGetStats ( )
$MemTot = Round ( ( $Mem[1] ) / 1024 , 0 ) + 1
GUICtrlSetData($Input2, $MemTot & " Mo de mémoire")
GUICtrlSetData($Input6, $memo2 & " % de mémoire utilisée")
GUICtrlSetData($Input7, $memo3 & " Ko Disponible")
GUICtrlSetData($Input8, $Label5 & " Ko de mémoire")
GUICtrlSetData($Input9, $memo5 & " Ko Disponible")
GUICtrlSetData($Input10, $Label6 & " Ko de mémoire")
GUICtrlSetData($Input11, $memo7 & " Ko Disponible")
GUICtrlSetData($Progress1, $st)
GUICtrlSetData($Progress2, $st1)
GUICtrlSetData($Progress3, $st2)
GUICtrlSetData($Progress4, $st3)
EndSwitch
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd