59

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.

1

3 Answers 3

84

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

0
14

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)


4
  • 1
    neato. I've never heard of this tool before. you got my upvote :)
    – Sass
    Aug 22, 2012 at 21:44
  • 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
    Dec 2, 2016 at 20:12
  • 1
    @jxramos escape \ (use double backslash \\ )
    – wmz
    Dec 2, 2016 at 20:34
  • @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
    Dec 3, 2016 at 2:20
7

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

1
  • 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. May 24, 2016 at 10:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .