Jump to content

Search the Community

Showing results for tags 'hdd'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 3 results

  1. ;RemoteDriveInfo ;v0.0.0.1 ;Ressource ;Smart Temp : https://www.autoitscript.com/forum/topic/91067-drive-temperature/?do=findComment&comment=1091961 ;GetPNPDeviceID From DriveLetter : https://www.autoitscript.com/forum/topic/57202-need-help-get-pnp-device-id-for-usb-drive/?do=findComment&comment=433346 ;Get Disk Space Info : https://www.autoitscript.com/forum/topic/148390-wmi-query-how-to-get-data-from-object/?do=findComment&comment=1055088 ;For A to Z : https://www.autoitscript.com/forum/topic/4804-fornext-loop-with-letters/?do=findComment&comment=30417 ;Include #include <Array.au3> #include <String.au3> ;Sample 1 ;$sComputerName $sComputerName = "PC1" ;$sComputerName = "PC2" ;$sComputerName = @ComputerName ;$sDrive ;$sDrive = "system" ;$sDrive = "D:" $sDrive = "" $DriveInfo = _GetDriveInfo($sComputerName, $sDrive) _ArrayDisplay($DriveInfo) ;Sample 2 $DriveInfo = _GetDriveInfo($sComputerName, "system") If $DriveInfo[0][0] = "DriveLeter" Then If $DriveInfo[1][6] <> "" Then MsgBox(0, "", $DriveInfo[1][6] & "° - " & $DriveInfo[1][4] & "% ( " & Round($DriveInfo[1][2]/1024^3) & "Go / " & Round($DriveInfo[1][3]/1024^3) & "Go )" & @CRLF) Else MsgBox(0, "", $DriveInfo[1][4] & "% ( " & Round($DriveInfo[1][2]/1024^3) & "Go / " & Round($DriveInfo[1][3]/1024^3) & "Go )" & @CRLF) EndIf Else MsgBox(0, "", $DriveInfo[0][0] & @CRLF) EndIf ;Function Func _GetSystemDriveLtr($sComputerName) $objWMI = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $sComputerName & "\root\cimv2") $colTemp = $objWMI.ExecQuery("SELECT SystemDrive FROM Win32_OperatingSystem") If IsObj($colTemp) then For $objItem In $colTemp $sSystemDriveLtr = $objItem.systemdrive Next EndIf Return $sSystemDriveLtr EndFunc ;==> _GetSystemDriveLtr Func _GetPNPDeviceID($drive_letter, $sComputerName) Local $drive_letter_found, $drive_letter_found $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $colItems = "" $objWMIService = ObjGet("winmgmts:\\" & $sComputerName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_LogicalDiskToPartition", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) Then For $objItem In $colItems $LogicalDiskToPartitionAntecedent = _StringBetween($objItem.Antecedent, '"', '"') $LogicalDiskToPartitionDependent = _StringBetween($objItem.Dependent, '"', '"') ;ConsoleWrite(@CR & $LogicalDiskToPartitionAntecedent[0] & " - " & $LogicalDiskToPartitionDependent[0]) $drive_statistics = $LogicalDiskToPartitionAntecedent[0] $drive_letter_found = $LogicalDiskToPartitionDependent[0] If $drive_letter = $drive_letter_found Then ExitLoop EndIf Next Else MsgBox(0, "WMI Output", "No WMI Objects Found for class: " & "Win32_LogicalDiskToPartition") EndIf If $drive_letter <> $drive_letter_found Then Return 0 ; If drive letter isn't function returns 0 $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_DiskDriveToDiskPartition", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) Then For $objItem In $colItems $DiskDriveToDiskPartitionAntecedent = _StringBetween($objItem.Antecedent, '"', '"') $DiskDriveToDiskPartitionDependent = _StringBetween($objItem.Dependent, '"', '"') ;ConsoleWrite(@CR & $DiskDriveToDiskPartitionAntecedent[0] & " - " & $DiskDriveToDiskPartitionDependent[0]) $drive_statistics_found = $DiskDriveToDiskPartitionDependent[0] $drive_physical = StringTrimLeft($DiskDriveToDiskPartitionAntecedent[0], StringInStr($DiskDriveToDiskPartitionAntecedent[0], "\", 1, -1)) ;MsgBox(0,"TEST", $drive_physical) If $drive_statistics = $drive_statistics_found Then ExitLoop EndIf Next Else MsgBox(0, "WMI Output", "No WMI Objects Found for class: " & "Win32_DiskDriveToDiskPartition") EndIf $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_DiskDrive", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) Then For $objItem In $colItems ;MsgBox(0,324234, $objItem.DeviceID) $DeviceID = StringTrimLeft($objItem.DeviceID, StringInStr($objItem.DeviceID, "\", 1, -1)) $PNPDeviceID = $objItem.PNPDeviceID ;MsgBox(0,122, $DeviceID) If $drive_physical = $DeviceID Then Return $PNPDeviceID EndIf Next Else MsgBox(0, "WMI Output", "No WMI Objects Found for class: " & "Win32_DiskDrive") EndIf EndFunc ;==> _GetPNPDeviceID Func _GetSmartTemp($InstanceName, $sComputerName) $objWMI = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $sComputerName & "\root\WMI") $colTemp = $objWMI.ExecQuery("SELECT * FROM MSStorageDriver_ATAPISmartData") $s = "" If IsObj($colTemp) and $InstanceName <> "" then For $objItem In $colTemp If StringInStr(StringUpper($objItem.InstanceName), StringUpper($InstanceName)) <> 0 Then $strVendorSpecific = $objItem.VendorSpecific For $i = 2 To UBound($strVendorSpecific) - 1 Step 12 If $strVendorSpecific[$i] = 0xC2 Then; find Vendor Parameter #194 - Temperatur $s &= " " & $strVendorSpecific[$i + 5]; Raw/Value celsuis ContinueLoop 2 EndIf Next For $i = 2 To UBound($strVendorSpecific) - 1 Step 12 If $strVendorSpecific[$i] = 0xBE Then; find Vendor Parameter #190 - Airflow Temperatur (if no tempetature is found) $s &= " " & $strVendorSpecific[$i + 5]; Raw/Value celsuis ContinueLoop 2 EndIf Next EndIf Next $s = StringTrimLeft($s, 1) Else $s = "" EndIf Return $s EndFunc ;==> _GetSmartTemp ;MainFunction Func _GetDriveInfo($sComputerName, $sDrive = "") Local $DriveArray[1][7] = [["DriveLeter", "FreespaceByte", "UsedspaceByte", "SizeByte", "UsedPercent", "IsSystem", "Temp"]] If Ping($sComputerName) = 0 Then Local $DriveArray[1][1] $DriveArray[0][0] = $sComputerName & " seems not online" Return $DriveArray EndIf If $sDrive = "" Then For $i = 65 To 90;For A to Z $sDriveLtr = Chr($i)&":" $DriveArray = _GetOneDriveInfo($sComputerName, $sDriveLtr, $DriveArray) Next ElseIf $sDrive = "system" Then $DriveArray = _GetOneDriveInfo($sComputerName, _GetSystemDriveLtr($sComputerName), $DriveArray) Else $DriveArray = _GetOneDriveInfo($sComputerName, $sDrive, $DriveArray) EndIf Return $DriveArray EndFunc ;==> _GetDriveInfo Func _GetOneDriveInfo($sComputerName, $sDriveLtr, $DriveArray) $objWMI = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $sComputerName & '\root\cimv2:Win32_LogicalDisk="' & $sDriveLtr & '"') If IsObj($objWMI) Then $UsedPercent = Round(100 / $objWMI.Size * ($objWMI.Size - $objWMI.FreeSpace)) If $UsedPercent <> -9223372036854775807 then $current_line = Ubound($DriveArray)+1 ReDim $DriveArray[$current_line][7] $DriveArray[$current_line-1][0] = $sDriveLtr $FreespaceByte = $objWMI.FreeSpace $DriveArray[$current_line-1][1] = $FreespaceByte $SizeByte = $objWMI.Size $DriveArray[$current_line-1][3] = $SizeByte $UsedspaceByte = $objWMI.Size - $objWMI.FreeSpace $DriveArray[$current_line-1][2] = $UsedspaceByte $UsedPercent = Round(100 / $objWMI.Size * ($objWMI.Size - $objWMI.FreeSpace)) $DriveArray[$current_line-1][4] = $UsedPercent If _GetSystemDriveLtr($sComputerName) = $sDriveLtr Then $IsSystem = 1 Else $IsSystem = 0 EndIf $DriveArray[$current_line-1][5] = $IsSystem $InstanceName = _GetPNPDeviceID($sDriveLtr, $sComputerName) $Temp = _GetSmartTemp($InstanceName, $sComputerName) $DriveArray[$current_line-1][6] = $Temp EndIf EndIf Return $DriveArray EndFunc Ressource Smart Temp : GetPNPDeviceID From DriveLetter : Get Disk Space Info : For A to Z :
  2. I've written a small surveillance tool for one of my programs. It shows the time that has already passed, the estimated time until the end, the average time of the steps, and the progress in %. It works pretty well, but I want to add some stats. That'd be the usages of the CPU, RAM, network and hard-drive of all threads in %. Basically what you see in the taskmanager, but without the list of every single process. I'm aware that there's no in-built function for that, and that I'd need an additional library. Are there any for that? Simply functions that return the stats mentioned above. Thanks! Edit: I run an ASUS R752M with an Intel BayTrail M3540 on Windows 10 64-bits.
  3. Hi, i have been stuck for a while now, and i can't seem to get it done. I have tried google and this forum but i can not find the answer i need. I am creating a installer, using autoit for deploying Windows Server 2008 with the option to a custom boot partion size. Right now i have pre determined the sizes that you can choose from, the only problem i have is that, the list has sizes in it that are bigger that the drive size. So what i want to create is a script that reads the drive size and makes a combolist starting from 40GB and then in steps of 10GB till it reaches the max size of the drive. I have attached the script i use. Hope anyone can help me sincerly, Mark Wingens Preload2.au3
×
×
  • Create New...