Find UNC path of a network drive?

后端 未结 5 2062
盖世英雄少女心
盖世英雄少女心 2020-11-30 19:03

I need to be able determine the path of the network Q drive at work for a WEBMethods project. The code that I have before is in my configuration file. I placed single charac

5条回答
  •  猫巷女王i
    2020-11-30 19:22

    The answer is a simple PowerShell one-liner:

    Get-WmiObject Win32_NetworkConnection | ft "RemoteName","LocalName" -A
    

    If you only want to pull the UNC for one particular drive, add a where statement:

    Get-WmiObject Win32_NetworkConnection | where -Property 'LocalName' -eq 'Z:'  | ft "RemoteName","LocalName" -A
    

提交回复
热议问题