Jump to content

Search the Community

Showing results for tags 'Auto Dectect drive Plugin'.

  • 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. Hi All, I use the following script to automatic add drives plugged in after starting a GUI. But on some computers the program exits with an AutoIt Error and it's caused by the following line $objWMIServices.ExecNotificationQueryAsync ($sink, "SELECT * FROM __InstanceOperationEvent WITHIN 5 WHERE " & "TargetInstance ISA 'Win32_LogicalDisk'") Does the above line depend on a specified service or something else ? For Example this script will not work with a windows installation installed by 'Windows "Arium" 3005 (May 2011 : 644Mo)' Download -> http://depositfiles.com/files/rb0vfsg8k Thanks Best regards, Emiel #Region #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Add_Constants=n #EndRegion #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #Include <GuiListView.au3> Dim $Drive_Set, $LVItems[30] Local $exStyles = BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES,$LVS_EX_CHECKBOXES) $strComputer = "." $objWMIServices = ObjGet("winmgmts:" & "{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2") $sink = ObjCreate("WbemScripting.SWbemSink") ObjEvent($sink,"SINK_") $objWMIServices.ExecNotificationQueryAsync ($sink, "SELECT * FROM __InstanceOperationEvent WITHIN 5 WHERE " & "TargetInstance ISA 'Win32_LogicalDisk'") $Parent = GUICreate("DriveList", 520, 320) $list = GUICtrlCreateListView("", 30, 30, 460, 260, BitOR($LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER, $LVS_REPORT)) _GUICtrlListView_SetExtendedListViewStyle($list, $exStyles) GUISetState () _GUICtrlListView_AddColumn($list, "Drive", 75) _GUICtrlListView_AddColumn($list, "Used", 92) _GUICtrlListView_AddColumn($list, "Free", 92) _GUICtrlListView_AddColumn($list, "Type", 75) _GUICtrlListView_AddColumn($list, "Label",112) _ListViewDiskInformation () _ListViewSetDiskInformation () While 1 $msg = GuiGetMsg() Switch $msg Case -3 Exit Case -100 To 0 ContinueLoop Case $GUI_EVENT_CLOSE Exit EndSwitch Wend Func _ListViewRenew () _GUICtrlListView_DeleteAllItems($list) _ListViewDiskInformation () _ListViewSetDiskInformation () EndFunc Func _ListViewDiskInformation () $Drive_Set = "" $DriveList = "" $Drive_Set = DriveGetDrive("ALL") EndFunc Func SINK_OnObjectReady($objObject, $objAsyncContext) If $objObject.TargetInstance.DriveType = 2 Then Select Case $objObject.Path_.Class()="__InstanceCreationEvent" _ListViewRenew () Case $objObject.Path_.Class()="__InstanceDeletionEvent" _ListViewRenew () EndSelect EndIf EndFunc Func _ListViewSetDiskInformation () For $i = 1 To $drive_set[0] $DriveType = DriveGetType($drive_set[$i]) $totals = Round(DriveSpaceTotal($drive_set[$i]) / 1024, 1) $spacef = Round(DriveSpaceFree($drive_set[$i]) / 1024, 1) $spaceu = Round(($totals - $spacef), 1) $LVItems[$i] = GUICtrlCreateListViewItem(StringUpper($drive_set[$i]) & "|" & $spaceu & " GB" & "|" & $spacef & " GB" & "|" & DriveGetFileSystem($drive_set[$i]) & "|" & DriveGetLabel($drive_set[$i]), $list) Next EndFunc
×
×
  • Create New...