Thanks.
Yes, those two WIN32 calls do seem to show the mapped drive letters
for both the telnet'ed user, and the currently logged in user.
Not really DOS commands, but I'll take what I can get
Wrote a small C++ program to exercise these calls: --- snip
#include <stdio.h>
#include <windows.h>
#include <memory.h>
// Show all drive maps
// Compiles as: cl /TP thisprogram.cxx
int main() {
char s[4096];
char *ss = s;
memset(s,0,sizeof(s));
if ( GetLogicalDriveStrings(sizeof(s)-1, s) == 0 ) {
fprintf(stderr, "GetLogicalDriveStrings() failed: %d\n", GetLastError());
return(1);
}
while ( *ss ) {
char uncpath[4096];
memset(uncpath, 0, sizeof(uncpath));
char drivename[10];
sprintf(drivename, "%.2s", ss);
if ( QueryDosDevice(drivename, uncpath, sizeof(uncpath)-1) == 0 ) {
fprintf(stderr, "QueryDosDevice(%s) failed: %d\n", drivename, GetLastError());
continue;
}
fprintf(stderr, "%s -- %s\n", drivename, uncpath);
ss += strlen(s) + 1;
}
return(0);
}
--- snip
Not perfect code, but good enough for testing.
When I run it, it shows both the X: and Z: drive maps, each created
by a different user:
C: -- \Device\HarddiskVolume1
D: -- \Device\CdRom0
E: -- \Device\Harddisk1\DP(1)0-0+6
F: -- \Device\Harddisk2\DP(1)0-0+7
G: -- \Device\Harddisk3\DP(1)0-0+8
H: -- \Device\Harddisk4\DP(1)0-0+9
X: -- \Device\LanmanRedirector\;X:0\meade\vartmp
Z: -- \Device\LanmanRedirector\;Z:0\meade\net
..in my case, X: is mapped to \\meade\vartmp, and Z: is mapped to \\meade\net.
I imagine sysadmins without compiler skills might have a problem with this,
though. Fortunately "ActiveState Perl" seems to also have access to these
WIN32 functions, so I guess it's not completely inaccessible.