Where does "net use" get its information from?

  • Thread starter Thread starter ginolard
  • Start date Start date
G

ginolard

Typing NET USE will display a list of mapped network drives. Where
does it get this information from?

It's from the current user's registry hive as that only contains drives
mapped by the user (i.e. not ones mapped by login script). So, where
is this info coming from?
 
Typing NET USE will display a list of mapped network drives. Where
does it get this information from?

It's from the current user's registry hive as that only contains drives
mapped by the user (i.e. not ones mapped by login script). So, where
is this info coming from?

AFAIK this information is held in memory by the redirector.
It is not stored in the registry. Does it matter where it is kept?
 
Pegasus said:
AFAIK this information is held in memory by the redirector.
It is not stored in the registry. Does it matter where it is kept?

Yes. I'd like to be able to read it (without having to trap the output
of NET USE)
 
Yes. I'd like to be able to read it (without having to trap the output
of NET USE)

You'll have to capture the output of "net use" or some similar
command. This is not hard!
 
Pegasus said:
You'll have to capture the output of "net use" or some similar
command. This is not hard!

Yes I know it's not hard. However, I've been looking for a 100%
reliable way to enumerate mapped drives on remote machines. I've
already done it well enough with VbScript and .NET code by finding the
user's SID and then enumerating the user's NETWORK registry tree.
However, this only contains drives mapped by the user. I realised
today that NET USE knows about ALL network drives and just wondered if
there was a simple way to read the information that it is reading. I
COULD use PSEXEC to execute Net Use on a remote machine, pipe the
output to a file and read the file but that's very clumsy.
 
In
Yes I know it's not hard. However, I've been looking for a 100%
reliable way to enumerate mapped drives on remote machines. I've
already done it well enough with VbScript and .NET code by finding the
user's SID and then enumerating the user's NETWORK registry tree.
However, this only contains drives mapped by the user. I realised
today that NET USE knows about ALL network drives and just wondered if
there was a simple way to read the information that it is reading. I
COULD use PSEXEC to execute Net Use on a remote machine, pipe the
output to a file and read the file but that's very clumsy.

Maybe this is a silly suggestion, but why not use login scripts that purge
and recreate all the drive mappings you want your users to have, rather than
worrying about what they've got locally mapped/remembered?
 
Lanwench said:
In

Maybe this is a silly suggestion, but why not use login scripts that purge
and recreate all the drive mappings you want your users to have, rather than
worrying about what they've got locally mapped/remembered?

Oh that's not why I'm asking. I've created an application, ManagePC
(http:\\www.managepc.net), that can scan any Windows 2000/XP machine
and gather certain information about it. Part of that information is
the mapped drives the user has. Someone reported, quite rightly, that
it doesn't retrieve drives mapped by, say, a login script.

Anyway, I've knocked together a Vbscript that captures the output of
Net Use and then reads it back in. It's clunky as hell but it works.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top