Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Confusion with ENUMSHARES

Aug
132
4
I'm checking out the newly released v21 and am confused over ENUMSHARES. First is the discrepancy between the help text and what the command line shows:

Help Text: ENUMSHARES [/- /A /D /F /I /P /Q /R /S /U /V] \\server\sharename
Command Line: ENUMSHARES [/A /D /F /I /P /Q /R /S /U /V] \server\sharename​

The former shows a double backslash before the server while the latter shows a single. No matter how I use it, however, I just get errors. The help text explicitly says, for example, that: "The sharename(s) to match. Sharenames may contain wildcards, including regular expressions." But when I try using "enumshares \\gondor\*" (\\gondor being a visible machine on my network properly listed by the ENUMSERVERS command), I get only variants of:

TCC: (Sys) The format of the specified share name is invalid.
"\\gondor\*"​

In short, I can't get any version of the command to work. Can somebody help me out? Thanks!
 
It seems to work here. Below, ZZ is the local machine, and lucky, a VPN connection, while not visible, is known to the LMHOSTS file.
Code:
v:\> enumshares /a \\zz\*
\\zz\ADMIN$
\\zz\C$
\\zz\E$
\\zz\F$
\\zz\G$
\\zz\H$

v:\> enumshares /a \\lucky\*
\\lucky\ADMIN$
\\lucky\C$
\\lucky\D
\\lucky\D$
\\lucky\E$
\\lucky\F$
\\lucky\G$
\\lucky\H$
\\lucky\I$

v:\> enumshares \\lucky\*
\\lucky\D
 
Hmm... I try that exact syntax (enumshares /a \\gondor\*) and all I get is "The format of the specified share name is invalid."
 
Hmm... I try that exact syntax (enumshares /a \\gondor\*) and all I get is "The format of the specified share name is invalid."
There's no "gondor" here, and that's what I get.
Code:
v:\> enumshares /a \\gondor\*
TCC: (Sys) The format of the specified share name is invalid.
 "\\gondor\*"
Just being visible may not be enough. Can you otherwise use gondor in any way?
 
Rex, if you're listening, I can't get ENUMSHARES to show print$, IPC$, or a specific printer.
upload_2017-4-28_1-12-11.png
 
In fact, it seems to stop prematurely, not showing me several shares.

upload_2017-4-28_1-17-22.png
 
There's no "gondor" here, and that's what I get.
Code:
v:\> enumshares /a \\gondor\*
TCC: (Sys) The format of the specified share name is invalid.
 "\\gondor\*"
Just being visible may not be enough. Can you otherwise use gondor in any way?

Yup. In fact, TakeCommand's own ENUMSERVERS command finds it nicely:

C:\Program Files\JPSoft\TCMD21> enumservers
\\GONDOR
\\TIRION​

And I can easily change directory to any of its shares using TakeCommand and do whatever. Everything seems to work fine except ENUMSHARES.
 
As I said in my last post, I think ENUMSHARES is stopping prematurely. I can't get anything past "H$" (and there are plenty more). I'm pretty sure that NET.EXE uses the same API.
upload_2017-4-28_17-1-18.png
 
Phileosophos, what does this command show you?

Code:
net view \\gondor /all
 
On my work machine, just as at home, ENUMSHARES /A seems to stop when it reaches IPC$ while there are several more that could (should?) be shown.
upload_2017-4-28_19-58-11.png
 
Phileosophos, what does this command show you?

Code:
net view \\gondor /all

Quite a lot, actually, all of it correct:

C:\Program Files\JPSoft\TCMD21>net view \\gondor /all
Shared resources at \\gondor



Share name Type Used as Comment

-------------------------------------------------------------------------------
Archive Disk V: Files no longer needed regularly
Development Disk P: Software and web site development
IPC$ IPC IPC Service ()
John Disk John's home folder
Media Disk U: Books, magazines, music, video, etc.
music Disk System default shared folder
NAS Disk Storage unit folder for reports and such
photo Disk System default shared folder
Software Disk T: Setups, updates, etc.
Steam Disk Steam backup files
Trialware Disk Warez and other stuff to try
video Disk System default shared folder
The command completed successfully.​
 
The output from your NET VIEW looks very different from mine. Do you know what kinds of shares they are? The programming docs give the following warning regarding the finction TCC uses to enumerate shares:
This function applies only to Server Message Block (SMB) shares. For other types of shares, such as Distributed File System (DFS) or WebDAV shares, use Windows Networking (WNet) functions, which support all types of shares.

Have you tried build 19 yet? My ENUMSHARES output was incomplete, but Rex fixed that in the latest build.
 
The output from your NET VIEW looks very different from mine. Do you know what kinds of shares they are? The programming docs give the following warning regarding the finction TCC uses to enumerate shares:


Have you tried build 19 yet? My ENUMSHARES output was incomplete, but Rex fixed that in the latest build.

I just updated and tried it. Same problem. FWIW, I know that the machine in question is hosting the shares as SMB. It's a Synology NAS. I believe it also has AFP enabled if that matters.
 
In fact, as I keep coming back to this command, I find enumshares doesn't work correctly with any machine other than the one on which it's run. Any attempt to use it on a machine on the network results in the error message. Does this command work at all as intended?
 
Back
Top