Jump to content

Recommended Posts

Posted

Hi guys,

Its been a while since I've used Autoit and was hoping that you all might be able to help me. Basically I need to check drive letters assigned to a remote computer. Its only the local drives so C: D: E: etc, doesn't need to be mapped drives. I've tried using DriveGetDrive but I can't work out how to search remote computers. Any help is appreciated!

Thanks for your time

  • Moderators
Posted

@AdamGJohnson you can do it with WMI, as long as you can connect to the machine:

Local $sPC = "RFHIS71"
Local $oWMI = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $sPC & "\root\cimv2")
    If IsObj($oWMI) Then
        $oDisks = $oWMI.ExecQuery("Select * from Win32_LogicalDisk Where DriveType='3'") ;3 - Local Disk
            If IsObj($oDisks) Then
                For $sDisk in $oDisks
                    ConsoleWrite($sDisk.FreeSpace & @CRLF)
                Next
            Else
                ConsoleWrite("Unable to collect LogicalDisk class info from " & $sPC & @CRLF)
            EndIf
    Else
        ConsoleWrite("Unable to connect to WMI on " & $sPC & @CRLF)
    EndIf

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Posted

Thanks for that! Its telling me the free space on the disk. How do I get it to tell me which drive letters are being used? I'm assuming the 'FreeSpace' needs to be changed, but I am uncertain to what. I really appreciate it.

  • Moderators
Posted

IIRC it would be Caption. I suggest doing a search on the forum for ScriptoMatic (downloads section). That will allow you to see all of the classes and their objects. If you look under win32_logicaldisk it will show you everything you can report on. 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...