Sign in to follow this  
Followers 0
AdamGJohnson

DriveGetDrive on remote computer

4 posts in this topic

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

Share this post


Link to post
Share on other sites



@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

 


When you're dead, you don't know you're dead - it's only difficult for those that know you. It's the same way when you're stupid...

My Scripts: SCCM UDFInclude Source with Compiled Script, Windows Firewall UDF

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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. 


When you're dead, you don't know you're dead - it's only difficult for those that know you. It's the same way when you're stupid...

My Scripts: SCCM UDFInclude Source with Compiled Script, Windows Firewall UDF

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0