Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"net use" command

Status
Not open for further replies.

elharti

Technical User
Apr 22, 2003
7
DE
Hello,
I have a question and I need your help!!

I have to write a batch file which should map a network drive for our domain users.

The problem is: we have different departements and there are some drive letters that aren't free (already mapped for some people permanently!!).

With the command net use * \\server\share I can take the first free drive letter. This batch file should at the end disconnect this share.

How can know which drive letter it had been mapped.

Thanks in advance!!

Cheers,
Hicham
 
If you only are mapping one drive letter, and you only want to disconnect the drive, end your batch file with:

net use * /Delete
 
Thanks for the replies!
But Bcastner if I use "net use * /delete" all mapped drives will be disconnected. But I only want to disconnect the share done with "net use * \\server\share". The drive letter is not known.
 
I understand, that was why I put the stipulation in my original response as to one map, etc.

As kippy13 said, you would need to find an unused drive letter. Or:

. If the batch process is early in the logon, then the normal logon script of mapping drive letters will "overmap" or overwrite your temporary assignment and there is no reason to delete the assignment;

. Just leave the map in place, it is not going to hurt anything. It is not going to add to your connection count against the server.



 
Yes that's true! Why should I disconnect the share? I didn't think abaout this bevor.

Normally all "not permanent" shares are disconnected after logoff and a new logon.

Thanks a lot!

Cheers,
Hicham
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top