Finding the physical local path associated with a Share UNC folder

52

10

Let's say I am Admin on a server named "Server1" and a share exists using the UNC path \\\Server1\Share1.

If I remote to Server 1 and log in as Admin, how do I find the physical drive location without scanning millions of folders given that a share folder could be defined ANYWHERE.

Chad

Posted 2012-08-22T19:27:27.047

Reputation: 1 654

Related: How do I find where a network drive is mapped to in Windows 7?

– Stevoisiak – 2018-01-18T16:23:14.880

Answers

80

Open a command prompt window and type net share, then hit Enter.

Sassafras_wot

Posted 2012-08-22T19:27:27.047

Reputation: 1 166

11

In addition to using net share, you can also use wmic - this allows you to query remote systems (with /node:) and also get only those you're interested in, eg.

List shares named Share1.

wmic /node:Server1 share where name="Share1" get name,path`

Pattern match to find only shares containing temp:

wmic share where 'name like ^"^%temp^%"' get name,path

Please note those strange looking ^ are carets - cmd escape char - those are used to avoid cmd to expand env. variables. If used from within wmic, they are not needed.

Finally, you could execute this against many machines at once and save list as nicely formatted html table (among other formats):

wmic /node:server1,server2 /output:shares.html share get name,path /format:htable

(you could also use a file to specify hosts with wmic /node: @file)


wmz

Posted 2012-08-22T19:27:27.047

Reputation: 6 132

Is it valid to put a condition for path like where path="C:\temp\somesharefolder" I keep getting ERROR: Description = Invalid query I'm trying to do a reverse lookup given the path that should be shared I'd like to lookup its shared name. – jxramos – 2016-12-02T20:12:45.347

1@jxramos escape \ (use double backslash \ ) – wmz – 2016-12-02T20:34:20.713

@wmz, works like a charm, had to do some string manipulation in cmd to chop the last 3 characters of the string which were some weird end of line thing or something. – jxramos – 2016-12-03T02:20:34.160

1neato. I've never heard of this tool before. you got my upvote :) – Sassafras_wot – 2012-08-22T21:44:03.973

6

Windows 7, via Remote Desktop Connection

If that machine has Windows and you can connect to it via Remote Desktop Connection:

Start > right click on Computer > Manage > Computer Management (Local) > System Tools > Shared Folders > Shares

Computer Manage

Computer Management

If you want to stop sharing, right click on one line > Stop Sharing:

enter image description here

ROMANIA_engineer

Posted 2012-08-22T19:27:27.047

Reputation: 572

This should also be achievable via remote mmc, to which permissions can be assigned separately from RDP, which might be handy for some (perhaps contrived?) situation. – underscore_d – 2016-05-24T10:44:46.920