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.

Toby Speight
  • 4,866
  • 1
  • 26
  • 36
Ivan
  • 2,094
  • 9
  • 29
  • 41
  • Related: [How do I find where a network drive is mapped to in Windows 7?](https://superuser.com/q/384692/358766) – Stevoisiak Jan 18 '18 at 16:23

3 Answers3

84

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

Indrek
  • 24,204
  • 14
  • 90
  • 93
Sass
  • 1,206
  • 9
  • 8
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)


Stevoisiak
  • 13,555
  • 39
  • 101
  • 154
wmz
  • 7,102
  • 1
  • 21
  • 32
  • 1
    neato. I've never heard of this tool before. you got my upvote :) – Sass Aug 22 '12 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 02 '16 at 20:12
  • 1
    @jxramos escape \ (use double backslash \\ ) – wmz Dec 02 '16 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 03 '16 at 02: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

ROMANIA_engineer
  • 642
  • 9
  • 17
  • 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 May 24 '16 at 10:44