Jump to content

Search the Community

Showing results for tags 'External hard drives'.

  • 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 1 result

  1. I had problem differentiating drives of system and External drives as they're both of same type - "FIXED" when using DriveGetDrive and DriveGetType, so managed to make a small script to detect External ones. Im a newb, so you may will find silly, unnecessary code which could have been done better with smart work instead of hard work, if you know what i mean #include <Array.au3> Local $drivelist = DriveGetDrive("FIXED"), $addspace = 0, $getspace, $systemdrives, $externaldrives ;~ _ArrayDisplay($drivelist) findexthdd() Func findexthdd() RunWait(@ComSpec & " /c " & 'wmic diskdrive get PNPDeviceID, size /format:csv | find /v "USBSTOR" > wmic.txt', @ScriptDir, @SW_HIDE) $file = FileOpen("wmic.txt") $readfile = FileRead($file) $readfile = StringSplit($readfile, ",") ;~ _ArrayDisplay($readfile) $last = $readfile[0] $totalsize = $readfile[$last] $totalsize = $totalsize / 1024 / 1024 / 1024 ;MB Do Local $c = 1 $totalsize = StringTrimRight($totalsize, $c) $c = $c + 1 $return = StringInStr($totalsize, ".") Until $return = 0 $return = 1 For $w = 1 To UBound($drivelist) - 1 $getspace = DriveSpaceTotal($drivelist[$w]) / 1024 Do Local $z = 1 $getspace = StringTrimRight($getspace, $z) $z = $z + 1 $return = StringInStr($getspace, ".") Until $return = 0 $addspace += $getspace If $addspace <= $totalsize Then ;463 vs 465 $systemdrives &= $drivelist[$w] & "," Else ;~ MsgBox(0, "", $drivelist[$w] & " is the f****** external hard drive!") $externaldrives &= $drivelist[$w] & "," EndIf Next $systemdrives = StringTrimRight($systemdrives, 1) $systemdrives = StringSplit($systemdrives, ",") _ArrayDisplay($systemdrives, "SYSTEM DRIVES LIST") $externaldrives = StringTrimRight($externaldrives, 1) $externaldrives = StringSplit($externaldrives, ",") _ArrayDisplay($externaldrives, "EXTERNAL DRIVES LIST") EndFunc ;==>findexthdd
×
×
  • Create New...