Finding physical path of mapped drive

I need to implement this into a web application.
i kow it is possible vis console application but that doesn't give client side information.

Is it possible to get Client side mapped drive's phsyical path



Answer this question

Finding physical path of mapped drive

  • Richard corrie

    hi Dustin,

    Thanks for this....
    But this gives we all the physical path of all file share on any machine...
    I am not sure that can we change it to het physical path of mapped drive

    regards,
    Manish

  • slackjaw

    Hi dustin,

    This indeed gives me logical drive details.....
    Can there we any property to fetch physical path as well

    I checked for "win32_logicaldisk" class...it doesn't seems to has any property for this.

    Any pointers..

  • Thiago Leite

    You may want to check out Atlas which is in Beta. Atlas will allow clients running client side Java to use very rich Basic or c# classes - client side or server side asynchronously. I am not up on it enough yet to say what will be done about sandboxing.

  • Bonsaicoder

    This code will also show the Drive letter and the Mapped path.



    On Error Resume Next
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalDisk",,48)
    For Each objItem in colItems
        Wscript.Echo "Access: " & objItem.Access
        Wscript.Echo "Availability: " & objItem.Availability
        Wscript.Echo "BlockSize: " & objItem.BlockSize
        Wscript.Echo "Caption: " & objItem.Caption
        Wscript.Echo "Compressed: " & objItem.Compressed
        Wscript.Echo "ConfigManagerErrorCode: " & objItem.ConfigManagerErrorCode
        Wscript.Echo "ConfigManagerUserConfig: " & objItem.ConfigManagerUserConfig
        Wscript.Echo "CreationClassName: " & objItem.CreationClassName
        Wscript.Echo "Description: " & objItem.Description
        Wscript.Echo "DeviceID: " & objItem.DeviceID
        Wscript.Echo "DriveType: " & objItem.DriveType
        Wscript.Echo "ErrorCleared: " & objItem.ErrorCleared
        Wscript.Echo "ErrorDescription: " & objItem.ErrorDescription
        Wscript.Echo "ErrorMethodology: " & objItem.ErrorMethodology
        Wscript.Echo "FileSystem: " & objItem.FileSystem
        Wscript.Echo "FreeSpace: " & objItem.FreeSpace
        Wscript.Echo "InstallDate: " & objItem.InstallDate
        Wscript.Echo "LastErrorCode: " & objItem.LastErrorCode
        Wscript.Echo "MaximumComponentLength: " & objItem.MaximumComponentLength
        Wscript.Echo "MediaType: " & objItem.MediaType
        Wscript.Echo "Name: " & objItem.Name
        Wscript.Echo "NumberOfBlocks: " & objItem.NumberOfBlocks
        Wscript.Echo "PNPDeviceID: " & objItem.PNPDeviceID
        Wscript.Echo "PowerManagementCapabilities: " & objItem.PowerManagementCapabilities
        Wscript.Echo "PowerManagementSupported: " & objItem.PowerManagementSupported
        Wscript.Echo "ProviderName: " & objItem.ProviderName
        Wscript.Echo "Purpose: " & objItem.Purpose
        Wscript.Echo "QuotasDisabled: " & objItem.QuotasDisabled
        Wscript.Echo "QuotasIncomplete: " & objItem.QuotasIncomplete
        Wscript.Echo "QuotasRebuilding: " & objItem.QuotasRebuilding
        Wscript.Echo "Size: " & objItem.Size
        Wscript.Echo "Status: " & objItem.Status
        Wscript.Echo "StatusInfo: " & objItem.StatusInfo
        Wscript.Echo "SupportsDiskQuotas: " & objItem.SupportsDiskQuotas
        Wscript.Echo "SupportsFileBasedCompression: " & objItem.SupportsFileBasedCompression
        Wscript.Echo "SystemCreationClassName: " & objItem.SystemCreationClassName
        Wscript.Echo "SystemName: " & objItem.SystemName
        Wscript.Echo "VolumeDirty: " & objItem.VolumeDirty
        Wscript.Echo "VolumeName: " & objItem.VolumeName
        Wscript.Echo "VolumeSerialNumber: " & objItem.VolumeSerialNumber
    Next

     



    Both scripts work fine for me.  I have several mapped drives on my system, and this code displays the information just fine.  The other chunk of code, only displayed Mapped drives.

    Dustin.


  • Phil_2005

    The most you'll get from that is the share path.  ie \\computer\path\...

    I'm not sure if there's a way for physical drive path of a remote machine unless you install a program to report it back.  I'm not sure you could do it web based...  beyond what i know though sorry.

    Dustin.


  • cpdeepak

    Wow Dustin that's beautiful. I was thinking WMI but I had no idea that java script could reference it. Way to go!

  • rahul8346



    On Error Resume Next
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    Set colItems = objWMIService.ExecQuery("Select * from Win32_Share",,48)
    For Each objItem in colItems
        Wscript.Echo "AccessMask: " & objItem.AccessMask
        Wscript.Echo "AllowMaximum: " & objItem.AllowMaximum
        Wscript.Echo "Caption: " & objItem.Caption
        Wscript.Echo "Description: " & objItem.Description
        Wscript.Echo "InstallDate: " & objItem.InstallDate
        Wscript.Echo "MaximumAllowed: " & objItem.MaximumAllowed
        Wscript.Echo "Name: " & objItem.Name
        Wscript.Echo "Path: " & objItem.Path
        Wscript.Echo "Status: " & objItem.Status
        Wscript.Echo "Type: " & objItem.Type
    Next

     



    Dustin.


  • Finding physical path of mapped drive