Page 1 sur 1
[R] Afficher le numéro ou position du disque
Posté : sam. 05 juin 2010 16:49
par camil
Bonjour,
Ce script liste les drive en donnant le numero de la partition, mais je voudrais qu'il affiche sur sur quelle disk.
exemple
Disk 1
Patition 1
Disk 1
partiton 2
Disk 2
Patition 1
Le plus important pour moi, c'est qu'il affcihe la position des disks dur.
Merci pour l'aide.
Re: [..] afficher le numero ou position du disk
Posté : sam. 05 juin 2010 17:55
par jl56
Bonjour
Je comprend pas bien ce que tu désire mais j'ai extrait un code d'un script CompInfo.au3
ce code affiche toutes les infos de chaque partition de chaque disque dur
► Afficher le texte
Code : Tout sélectionner
If Not(IsDeclared("$cI_CompName")) Then
Global $cI_CompName = @ComputerName
EndIf
Global Const $cI_VersionInfo = "00.03.08"
Global Const $cI_aName = 0, _
$cI_aDesc = 4
Global $wbemFlagReturnImmediately = 0x10, _ ;DO NOT CHANGE
$wbemFlagForwardOnly = 0x20 ;DO NOT CHANGE
Global $ERR_NO_INFO = "Array contains no information", _
$ERR_NOT_OBJ = "$colItems isnt an object"
Dim $dpart
_Disquepartition($dpart)
If @error Then
$error = @error
$extended = @extended
Switch $extended
Case 1
_ErrorMsg($ERR_NO_INFO)
Case 2
_ErrorMsg($ERR_NOT_OBJ)
EndSwitch
EndIf
;~ MsgBox(0,"din",$dpart[0][0])
For $i = 1 To $dpart[0][0] Step 1
MsgBox(0, "Test _disque part", "Name: " & $dpart[$i][19] & @CRLF & _
"Access; " & $dpart[$i][0] & @CRLF & _
"Availability; " & $dpart[$i][1] & @CRLF & _
"BlockSize; " & $dpart[$i][2] & @CRLF & _
"Bootable; " & $dpart[$i][3] & @CRLF & _
"BootPartition; " & $dpart[$i][4] & @CRLF & _
"Caption; " & $dpart[$i][5] & @CRLF & _
"ConfigManagerErrorCode; " & $dpart[$i][6] & @CRLF & _
"ConfigManagerUserConfig; " & $dpart[$i][7] & @CRLF & _
"CreationClassName; " & $dpart[$i][8] & @CRLF & _
"Description; " & $dpart[$i][9] & @CRLF & _
"DeviceID; " & $dpart[$i][10] & @CRLF & _
"DiskIndex; " & $dpart[$i][11] & @CRLF & _
"ErrorCleared; " & $dpart[$i][12] & @CRLF & _
"ErrorDescription; " & $dpart[$i][13] & @CRLF & _
"ErrorMethodology; " & $dpart[$i][14] & @CRLF & _
"HiddenSectors; " & $dpart[$i][15] & @CRLF & _
"Index; " & $dpart[$i][16] & @CRLF & _
"InstallDate; " & $dpart[$i][17] & @CRLF & _
"LastErrorCode; " & $dpart[$i][18] & @CRLF & _
"NumberOfBlocks; " & $dpart[$i][20] & @CRLF & _
"PNPDeviceID; " & $dpart[$i][21] & @CRLF & _
"PowerManagementCapabilities[]; " & $dpart[$i][22] & @CRLF & _
"PowerManagementSupported; " & $dpart[$i][23] & @CRLF & _
"PrimaryPartition; " & $dpart[$i][24] & @CRLF & _
"Purpose; " & $dpart[$i][25] & @CRLF & _
"RewritePartition; " & $dpart[$i][26] & @CRLF & _
"Size; " & $dpart[$i][27] &" "&int((Number($dpart[$i][27])/1024/1024/1024)*100)/100&" GO"& @CRLF & _
"StartingOffset; " & $dpart[$i][28] & @CRLF & _
"Status; " & $dpart[$i][29] & @CRLF & _
"StatusInfo; " & $dpart[$i][30] & @CRLF & _
"SystemCreationClassName; " & $dpart[$i][31] & @CRLF & _
"SystemName; " & $dpart[$i][32])
Next
#endregion BType ;IOS
Func _Disquepartition(ByRef $adisquepartitionInfo)
Local $colItems, $objWMIService, $objItem
Dim $adisquepartitionInfo[1][34], $i = 1
$objWMIService = ObjGet("winmgmts:\\" & $cI_Compname & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_DiskPartition", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) Then
For $objItem In $colItems
ReDim $adisquepartitionInfo[UBound($adisquepartitionInfo) + 1][34]
$adisquepartitionInfo[$i][0] = $objItem.Access
$adisquepartitionInfo[$i][1] = $objItem.Availability
$adisquepartitionInfo[$i][2] = $objItem.BlockSize
$adisquepartitionInfo[$i][3] = $objItem.Bootable
$adisquepartitionInfo[$i][4] = $objItem.BootPartition
$adisquepartitionInfo[$i][5] = $objItem.Caption
$adisquepartitionInfo[$i][6] = $objItem.ConfigManagerErrorCode
$adisquepartitionInfo[$i][7] = $objItem.ConfigManagerUserConfig
$adisquepartitionInfo[$i][8] = $objItem.CreationClassName
$adisquepartitionInfo[$i][9] = $objItem.Description
$adisquepartitionInfo[$i][10] = $objItem.DeviceID
$adisquepartitionInfo[$i][11] = $objItem.DiskIndex
$adisquepartitionInfo[$i][12] = $objItem.ErrorCleared
$adisquepartitionInfo[$i][13] = $objItem.ErrorDescription
$adisquepartitionInfo[$i][14] = $objItem.ErrorMethodology
$adisquepartitionInfo[$i][15] = $objItem.HiddenSectors
$adisquepartitionInfo[$i][16] = $objItem.Index
$adisquepartitionInfo[$i][17] = $objItem.InstallDate
$adisquepartitionInfo[$i][18] = $objItem.LastErrorCode
$adisquepartitionInfo[$i][19] = $objItem.Name
$adisquepartitionInfo[$i][20] = $objItem.NumberOfBlocks
$adisquepartitionInfo[$i][21] = $objItem.PNPDeviceID
$adisquepartitionInfo[$i][22] = $objItem.PowerManagementCapabilities(0)
$adisquepartitionInfo[$i][23] = $objItem.PowerManagementSupported
$adisquepartitionInfo[$i][24] = $objItem.PrimaryPartition
$adisquepartitionInfo[$i][25] = $objItem.Purpose
$adisquepartitionInfo[$i][26] = $objItem.RewritePartition
$adisquepartitionInfo[$i][27] = $objItem.Size
$adisquepartitionInfo[$i][28] = $objItem.StartingOffset
$adisquepartitionInfo[$i][29] = $objItem.Status
$adisquepartitionInfo[$i][30] = $objItem.StatusInfo
$adisquepartitionInfo[$i][31] = $objItem.SystemCreationClassName
$adisquepartitionInfo[$i][32] = $objItem.SystemName
$adisquepartitionInfo[$i][33] = $objItem.Type
$i += 1
Next
$adisquepartitionInfo[0][0] = UBound($adisquepartitionInfo) - 1
If $adisquepartitionInfo[0][0] < 1 Then
SetError(1, 1, 0)
EndIf
Else
SetError(1, 2, 0)
EndIf
EndFunc ;$adisquepartitionInfo
#region ---- Internal Functions
Func _ErrorMsg($message, $time = 0)
MsgBox(48 + 262144, "Error!", $message, $time)
EndFunc
#endregion Internal Functions
cela fonctionne avec les wmi
a toi de sélectionner ce que tu veux
A+ jl56
Re: [..] afficher le numero ou position du disk
Posté : sam. 05 juin 2010 21:17
par camil
Je voulais juste afficher les disk présent physiquement et leur position avec leur taille total et poser la question du disk choisi pour restaurer une image ghost.
Exemple:
DeviceID = Disk 0
Taille total du disque = 200 Go
DeviceID = Disk 1
Taille total du disque = 500 Go
Choix du disque destination : 1
C'est pour que l'utilisateur choisisse le disk de destination 1 ou 2 ou 3 par sa taille total, je veux pas les partition mais que les disks. J'utilise ghost avec une ligne de commande automatique pour restaurer.
C’est comme avec diskpart -> List disk
Merci pour l'aide.
Re: [..] afficher le numero ou position du disk
Posté : sam. 05 juin 2010 22:01
par sylvanie
Il y a quasiment déjà tout dans votre script de départ, il manque juste une conversion en Go de la taille, ou bien j'ai mal compris ?
l'appel GetLogicalDrives apporte quoi par rapport à DrivegetDrive fournit par Autoit ?
sinon voici une petite modif faisant la conversion si ça peut aider
► Afficher le texte
Code : Tout sélectionner
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.6.1
Author: myName
Script Function:
Template AutoIt script.
#ce ----------------------------------------------------------------------------
; Script Start - Add your code below here
#Include <Array.au3>
Local Const $tagGUID1 = "uint Data1;ushort Data2;ushort Data3;ubyte Data4[8];"
Local Const $tagPARTITION_INFORMATION_MBR = "ubyte PartitionType;ubyte BootIndicator;ubyte RecognizedPartition;uint HiddenSectors;"
Local Const $tagPARTITION_INFORMATION_GPT = $tagGUID1 & $tagGUID1 & "uint64 Attributes;wchar Name[36];"
Local Const $tagPARTITION_INFORMATION_EX_GPT = _
"int PartitionStyle;" & _
"int64 StartingOffset;" & _
"int64 PartitionLength;" & _
"uint PartitionNumber;" & _
"ubyte RewritePartition;" & _
$tagPARTITION_INFORMATION_GPT
Local Const $tagPARTITION_INFORMATION_EX_MBR = _
"int PartitionStyle;" & _
"int64 StartingOffset;" & _
"int64 PartitionLength;" & _
"uint PartitionNumber;" & _
"ubyte RewritePartition;" & _
$tagPARTITION_INFORMATION_MBR & "dword[26];"
;Local $aCall = DllCall("kernel32.dll", "dword", "GetLogicalDrives")
;Local $iMask = $aCall[0]
Local $tPIX = DllStructCreate($tagPARTITION_INFORMATION_EX_GPT)
Local $hDevice
Local $a_hCall, $a_iCall
$list_drive=DriveGetDrive("FIXED")
if @error Then Exit 1
$nb_drive = $list_drive[0]
For $i = 1 To $nb_drive
$a_hCall = DllCall("kernel32.dll", "hwnd", "CreateFile", _
"str", "\\.\" & $list_drive[$i], _; want handle to the logical drive
"dword", 0, _
"dword", 0, _
"ptr", 0, _
"dword", 3, _; OPEN_EXISTING
"dword", 128, _; FILE_ATTRIBUTE_NORMAL
"ptr", 0)
$hDevice = $a_hCall[0]
$a_iCall = DllCall("kernel32.dll", "int", "DeviceIoControl", _
"hwnd", $hDevice, _
"dword", 0x70048, _; IOCTL_DISK_GET_PARTITION_INFO_EX
"ptr", 0, _
"dword", 0, _
"ptr", DllStructGetPtr($tPIX), _
"dword", DllStructGetSize($tPIX), _
"dword*", 0, _
"ptr", 0)
DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $hDevice)
$size_drive=Int(DriveSpaceTotal($list_drive[$i])/1024);conversion en giga
ConsoleWrite("Drive " &$list_drive[$i]& " " & @CRLF)
ConsoleWrite(@TAB & "StartingOffset: " & DllStructGetData($tPIX, "StartingOffset") & @CRLF)
ConsoleWrite(@TAB & "PartitionLength: " & DllStructGetData($tPIX, "PartitionLength") & @CRLF)
ConsoleWrite(@TAB & "PartitionSize: "&$size_drive & @CRLF)
ConsoleWrite(@TAB & "PartitionNumber: " & DllStructGetData($tPIX, "PartitionNumber") & @CRLF)
ConsoleWrite(@CRLF)
MsgBox("", "", "DRIVE : " & $list_drive[$i] & @CRLF & "PartitionNumber: " & DllStructGetData($tPIX, "PartitionNumber")&@CRLF&"Partitionsize: "&$size_drive&" Go")
Next
Re: [..] Qfficher le numéro ou position du disque
Posté : dim. 06 juin 2010 10:49
par camil
Bonjour,
Je ne cherche pas a voire les partition de chaque disk dur.
C'est le nombre de disk dur present et sa taille total sur le PC.
voila l'affichage que je cherche avec les exemples avec "diskpart" sous commande DOS et "gestion des disques" sous WINDOWS.
Comme ca sous GHOST je pourrais rendre automatique le choix du disque dur de destination.
Merci pour votre patience et pour l'aide.
Re: [..] Qfficher le numéro ou position du disque
Posté : dim. 06 juin 2010 11:08
par jl56
Bonjour à tous
@camil test ceci
► Afficher le texte
Code : Tout sélectionner
Global $WBEMFLAGRETURNIMMEDIATELY = 16
Global $WBEMFLAGFORWARDONLY = 32
$STRCOMPUTER = StringLower(@ComputerName)
If @error = 1 Then Exit
$COLITEMS = ""
$OBJWMISERVICE = ObjGet("winmgmts:\\" & $STRCOMPUTER & "\root\CIMV2")
$COLITEMS = $OBJWMISERVICE.ExecQuery("SELECT SerialNumber FROM Win32_PhysicalMedia")
If IsObj($COLITEMS) Then
For $OBJITEM In $COLITEMS
If $OBJITEM.tag = "\\.\PHYSICALDRIVE0" Then $Serial_disque = StringStripWS($OBJITEM.SerialNumber, 3)
Next
EndIf
$OBJWMISERVICE = ObjGet("winmgmts:\\" & $STRCOMPUTER & "\root\CIMV2")
$COLITEMS = $OBJWMISERVICE.ExecQuery("SELECT * FROM Win32_DiskDrive", "WQL", $WBEMFLAGRETURNIMMEDIATELY + $WBEMFLAGFORWARDONLY)
If IsObj($COLITEMS) Then
$nbrdisque = 0
For $OBJITEM In $COLITEMS
$BytesPerSector = $OBJITEM.BytesPerSector
$TotalSectors = $OBJITEM.TotalSectors
$nbr_partition = $OBJITEM.Partitions
$model_disque = $OBJITEM.Model
$taille_disque = Int(($BytesPerSector * $TotalSectors) / 1024 / 1024 / 10.24) / 100
MsgBox(0, "disk info", "Pour le disque " & $model_disque & @CRLF &@CRLF& "Son numéro est " & $nbrdisque & @CRLF & "Sa taille est de " & $taille_disque & " Go" & @CRLF & "Il y a " & $nbr_partition & " partition(s)")
$nbrdisque = $nbrdisque + 1
Next
EndIf
A+ JL56
Re: [..] Qfficher le numéro ou position du disque
Posté : dim. 06 juin 2010 14:37
par camil
Je peux que te dire un grand merci.
J'ai modifier pour que sa demare a 1 et pas 0 comme sur GHOST.
Mais je n'arrive pas a afficher les infos dans une meme fenetre et poser la question a utilisateur "CHOIX DU DISK DE DESTINATION : " ecrivant sa position "1" ou "2" ...dans une varible "$choix"
► Afficher le texte
Code : Tout sélectionner
Global $WBEMFLAGRETURNIMMEDIATELY = 16
Global $WBEMFLAGFORWARDONLY = 32
$STRCOMPUTER = StringLower(@ComputerName)
If @error = 1 Then Exit
$COLITEMS = ""
$OBJWMISERVICE = ObjGet("winmgmts:\\" & $STRCOMPUTER & "\root\CIMV2")
$COLITEMS = $OBJWMISERVICE.ExecQuery("SELECT SerialNumber FROM Win32_PhysicalMedia")
If IsObj($COLITEMS) Then
For $OBJITEM In $COLITEMS
If $OBJITEM.tag = "\\.\PHYSICALDRIVE0" Then $Serial_disque = StringStripWS($OBJITEM.SerialNumber, 3)
Next
EndIf
$OBJWMISERVICE = ObjGet("winmgmts:\\" & $STRCOMPUTER & "\root\CIMV2")
$COLITEMS = $OBJWMISERVICE.ExecQuery("SELECT * FROM Win32_DiskDrive", "WQL", $WBEMFLAGRETURNIMMEDIATELY + $WBEMFLAGFORWARDONLY)
If IsObj($COLITEMS) Then
$nbrdisque = 0
For $OBJITEM In $COLITEMS
$BytesPerSector = $OBJITEM.BytesPerSector
$TotalSectors = $OBJITEM.TotalSectors
$nbr_partition = $OBJITEM.Partitions
$model_disque = $OBJITEM.Model
$taille_disque = Int(($BytesPerSector * $TotalSectors) / 1024 / 1024 / 10.24) / 100
$nbrdisque = $nbrdisque + 1
MsgBox(0, "disk info", "Disk -> " & $nbrdisque & @CRLF &"Model -> " & $model_disque & @CRLF & "Taille -> " & $taille_disque & " Go")
;$nbrdisque = $nbrdisque + 1
Next
EndIf
Merci a tous pour l'aide.
Re: [..] Qfficher le numéro ou position du disque
Posté : dim. 06 juin 2010 15:55
par jl56
voila
► Afficher le texte
Code : Tout sélectionner
Global $WBEMFLAGRETURNIMMEDIATELY = 16
Global $WBEMFLAGFORWARDONLY = 32
Dim $nbrdisque[20], $taille_disque[20], $model_disque[20]
Global $STRCOMPUTER = StringLower(@ComputerName)
If @error = 1 Then Exit
Global $COLITEMS = ""
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Form1", 633, 447, 192, 124)
Global $combo_disque_ghost = GUICtrlCreateCombo("", 168, 76, 400, 25)
Global $bt_lancement_ghost = GUICtrlCreateButton("Lancement du ghost", 176, 152, 175, 25, $WS_GROUP)
Global $Label1 = GUICtrlCreateLabel("Choisir le disque a ghoster", 10, 80, 150, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
inventaire_disque()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $bt_lancement_ghost
If GUICtrlRead($combo_disque_ghost) <> "" Then
For $i = 1 To $nbrdisque
If $model_disque[$i] & " Disque N° " & $i & " de " & $taille_disque[$i] & " GO" = GUICtrlRead($combo_disque_ghost) Then
MsgBox(0, "ghost de", GUICtrlRead($combo_disque_ghost) )
$choix_disque=$i
MsgBox(0, "choix = ", "Disque n° " & $i)
EndIf
Next
Else
MsgBox(0, "Erreur", "Vous n'avez pas choisie de disque dur ", 20)
EndIf
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Exit
Func inventaire_disque()
$OBJWMISERVICE = ObjGet("winmgmts:\\" & $STRCOMPUTER & "\root\CIMV2")
$COLITEMS = $OBJWMISERVICE.ExecQuery("SELECT SerialNumber FROM Win32_PhysicalMedia")
If IsObj($COLITEMS) Then
For $OBJITEM In $COLITEMS
If $OBJITEM.tag = "\\.\PHYSICALDRIVE0" Then $Serial_disque = StringStripWS($OBJITEM.SerialNumber, 3)
Next
EndIf
$OBJWMISERVICE = ObjGet("winmgmts:\\" & $STRCOMPUTER & "\root\CIMV2")
$COLITEMS = $OBJWMISERVICE.ExecQuery("SELECT * FROM Win32_DiskDrive", "WQL", $WBEMFLAGRETURNIMMEDIATELY + $WBEMFLAGFORWARDONLY)
If IsObj($COLITEMS) Then
$nbrdisque = 0
For $OBJITEM In $COLITEMS
$BytesPerSector = $OBJITEM.BytesPerSector
$TotalSectors = $OBJITEM.TotalSectors
$nbrdisque = $nbrdisque + 1
$nbr_partition = $OBJITEM.Partitions
$model_disque[$nbrdisque] = $OBJITEM.Model
$taille_disque[$nbrdisque] = Int(($BytesPerSector * $TotalSectors) / 1024 / 1024 / 10.24) / 100
GUICtrlSetData($combo_disque_ghost, $model_disque[$nbrdisque] & " Disque N° " & $nbrdisque & " de " & $taille_disque[$nbrdisque] & " GO")
;~ MsgBox(0, "disk info", "Pour le disque " & $model_disque & @CRLF &@CRLF& "Son numéro est " & $nbrdisque & @CRLF & "Sa taille est de " & $taille_disque & " Go" & @CRLF & "Il y a " & $nbr_partition & " partition(s)")
Next
EndIf
EndFunc ;==>inventaire_disque
Maintenant c'est à vous de continuer. investissez vous dans autoit. au début pour faire un code aussi simple
je passai des mois ( vrai de vrai, je sais j'étais nul ) mais maintenant je le suis un peu moins nul ( faux pas exagérer comme même).
Vos questions évoluent au fil de vos posts ce n'est pas forcement facile à suivre
A+ JL56
Re: [..] Qfficher le numéro ou position du disque
Posté : dim. 06 juin 2010 19:29
par camil
Merci pour les conseils.
Ton script est impect, mais je manque d'experience.
Je fais comment comment pour sortir la valeur $i en dehors du While 1
car si je sors le message box il ne se passe rien !
ou j'ai fait l'erreur ?
► Afficher le texte
Code : Tout sélectionner
Global $WBEMFLAGRETURNIMMEDIATELY = 16
Global $WBEMFLAGFORWARDONLY = 32
Dim $nbrdisque[20], $taille_disque[20], $model_disque[20]
Global $STRCOMPUTER = StringLower(@ComputerName)
Global $i
If @error = 1 Then Exit
Global $COLITEMS = ""
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Global $i
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Form1", 370, 160, 192, 124)
Global $Label1 = GUICtrlCreateLabel("Choisir le disque destination ?", 30, 20, 150, 17)
Global $combo_disque_ghost = GUICtrlCreateCombo("", 30, 40, 300, 25)
Global $bt_lancement_ghost = GUICtrlCreateButton("OK", 100, 90, 175, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
inventaire_disque()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $bt_lancement_ghost
If GUICtrlRead($combo_disque_ghost) <> "" Then
For $i = 1 To $nbrdisque
If $model_disque[$i] & " Disque N° " & $i & " de " & $taille_disque[$i] & " GO" = GUICtrlRead($combo_disque_ghost) Then
;MsgBox(0, "ghost de", GUICtrlRead($combo_disque_ghost) )
$choix_disque=$i
;MsgBox(0, "choix = ", "Disque n° " & $i)
Exit
EndIf
Next
Else
MsgBox(0, "Erreur", "Vous n'avez pas choisie de disque dur ", 20)
EndIf
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func inventaire_disque()
$OBJWMISERVICE = ObjGet("winmgmts:\\" & $STRCOMPUTER & "\root\CIMV2")
$COLITEMS = $OBJWMISERVICE.ExecQuery("SELECT SerialNumber FROM Win32_PhysicalMedia")
If IsObj($COLITEMS) Then
For $OBJITEM In $COLITEMS
If $OBJITEM.tag = "\\.\PHYSICALDRIVE0" Then $Serial_disque = StringStripWS($OBJITEM.SerialNumber, 3)
Next
EndIf
$OBJWMISERVICE = ObjGet("winmgmts:\\" & $STRCOMPUTER & "\root\CIMV2")
$COLITEMS = $OBJWMISERVICE.ExecQuery("SELECT * FROM Win32_DiskDrive", "WQL", $WBEMFLAGRETURNIMMEDIATELY + $WBEMFLAGFORWARDONLY)
If IsObj($COLITEMS) Then
$nbrdisque = 0
For $OBJITEM In $COLITEMS
$BytesPerSector = $OBJITEM.BytesPerSector
$TotalSectors = $OBJITEM.TotalSectors
$nbrdisque = $nbrdisque + 1
$nbr_partition = $OBJITEM.Partitions
$model_disque[$nbrdisque] = $OBJITEM.Model
$taille_disque[$nbrdisque] = Int(($BytesPerSector * $TotalSectors) / 1024 / 1024 / 10.24) / 100
GUICtrlSetData($combo_disque_ghost, $model_disque[$nbrdisque] & " Disque N° " & $nbrdisque & " de " & $taille_disque[$nbrdisque] & " GO")
;~ MsgBox(0, "disk info", "Pour le disque " & $model_disque & @CRLF &@CRLF& "Son numéro est " & $nbrdisque & @CRLF & "Sa taille est de " & $taille_disque & " Go" & @CRLF & "Il y a " & $nbr_partition & " partition(s)")
Next
EndIf
EndFunc ;==>inventaire_disque
MsgBox(0, "choix = ", "Disque n° " & $i)
Merci et a+.
Re: [..] Qfficher le numéro ou position du disque
Posté : dim. 06 juin 2010 20:52
par jl56
En regardant un minimum le code. Vous auriez remarqué que je stock la valeur de $i dans la la variable
$choix_disque
J'avais anticipé votre demande
à la place du msgbox et avant exit tapez les lignes de commande pour votre ghost
Travaillez un peu comme même. L'aide Autoit est bien faite et les exemples instructifs
sur le forum vous avez des tutos et des exemples par centaines
lit également ce tuto
http://www.siteduzero.com/tutoriel-3-22 ... utoit.html
Superbe travail réalisé en partie par Timmalos ,Tlem et d'autres voir sur le site ( Merci a eux )
Il ouvre les yeux sur des méthodes et fonctionnalité d'autoit
Merci de passer ce post en résolu
A+ JL56
Re: [..] Qfficher le numéro ou position du disque
Posté : lun. 07 juin 2010 08:33
par camil
Bonjour,
Oui, j'avais vue pour $choix_disque=$i
Je viens de testé sur Bartpe ou Winpe, il me genere une erreur : Line -1 Error: variable must be off type "objet"
Je chercherais pourquoi dans un futur proche, c'est a dire quand je metriserais mieux.
Merci quand meme.