1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Net Use

Discussion in 'Networking (Hardware & Software)' started by Isaac M, 2009/02/12.

  1. 2009/02/12
    Isaac M

    Isaac M Inactive Thread Starter

    Joined:
    2008/07/01
    Messages:
    7
    Likes Received:
    0
    Hi

    We run a bat logon script to map network drives using the "net use" command.

    At the moment it looks like this

    rem Define Network Map Drives

    net use * /DELETE /y
    net use H: "\\server\sys"
    net use P: "\\server\sys1"

    This obviously results in users seeing an H and P drive on their systems:

    sys on 'File Server (server)' (H:)
    sys1 on 'File Server (server)' (P:)

    Is it possible to have it show a custom name like below?

    sys on 'File Server (server)' (H:Templates)
    sys1 on 'File Server (server)' (P:projects)

    :edit: My apologies if this should rather go under the "Windows Server" section
     
    Last edited: 2009/02/13
  2. 2009/02/13
    Steve R Jones

    Steve R Jones SuperGeek Staff

    Joined:
    2001/12/30
    Messages:
    12,317
    Likes Received:
    252
    You could try adding the following to the batch file:

    label H:\ Templates
    label P:\ Projects
     

  3. to hide this advert.

  4. 2009/02/13
    Isaac M

    Isaac M Inactive Thread Starter

    Joined:
    2008/07/01
    Messages:
    7
    Likes Received:
    0
    Apparently the "label" command does not work,
    "Label writes to the partition table. There are no partition tables with mapped drives. So that command can't be used. "

    but I found the following:

    http://www.computing.net/answers/windows-2000/rename-mapped-drives/42894.html

    I still have to check on my system

    1) map share with net use .........
    2) immediately following run this:

    regedit /s \\servershare\patch.reg

    The patch.reg file has to be specific for the mapped share (I had to create 10).

    The patch.reg file contains the following:

    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\S\_LabelFromReg]
    "Version "=dword:00000005
    "LastUpdate "=dword:00091cb0
    "Cache "=hex:43,00,65,00,6e,00,74,00,65,00,72,00,73,00,20,00,6f,00,66,00,20,00,\
    45,00,78,00,63,00,65,00,6c,00,6c,00,65,00,6e,00,63,00,65,00,00,00,00,00,00,\
    00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

    The structure is as follows:

    Key: USER\Soft\MS\Windows\Current\Explorer\MountPoints\S\_LabelFromReg
    ( "S" is the letter of the mapped drive. Corresponds to whatever drive letter is assigned with net use)

    Version:
    Works with any number greater than 1 it seems.

    Last Update:
    (not important)

    Cache:
    This is the string which will "label" the mapped drive. Is required to be in hex form so you will need a converter. (*note* if you replace the Cache key with a string type key named Cache it will convert to hex for you.)

    Now my login script looks like the following:
    #psuedocode#

    ifmember group1
    if error level 1 goto next
    net use s: \\server\deptshare
    regedit /s \\server\folder\group1.reg
    :next
    ifmember group2
    if error level 1 goto next
    net use s: \\server\deptshare
    regedit /s \\server\folder\group2.reg
    :next
    ...
     
  5. 2009/02/13
    Isaac M

    Isaac M Inactive Thread Starter

    Joined:
    2008/07/01
    Messages:
    7
    Likes Received:
    0
    Thanks, but apparently label doesn't work on mapped network drives because:

    Label writes to the partition table. There are no partition tables with mapped drives. So that command can't be used.

    but I did find this. Still trying to make it work on our network.

    1) map share with net use .........
    2) immediately following run this:

    regedit /s \\servershare\patch.reg

    The patch.reg file has to be specific for the mapped share (I had to create 10).

    The patch.reg file contains the following:

    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\S\_LabelFromReg]
    "Version "=dword:00000005
    "LastUpdate "=dword:00091cb0
    "Cache "=hex:43,00,65,00,6e,00,74,00,65,00,72,00,73,00,20,00,6f,00,66,00,20,00,\
    45,00,78,00,63,00,65,00,6c,00,6c,00,65,00,6e,00,63,00,65,00,00,00,00,00,00,\
    00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

    The structure is as follows:

    Key: USER\Soft\MS\Windows\Current\Explorer\MountPoints\S\_LabelFromReg
    ( "S" is the letter of the mapped drive. Corresponds to whatever drive letter is assigned with net use)

    Version:
    Works with any number greater than 1 it seems.

    Last Update:
    (not important)

    Cache:
    This is the string which will "label" the mapped drive. Is required to be in hex form so you will need a converter. (*note* if you replace the Cache key with a string type key named Cache it will convert to hex for you.)

    Now my login script looks like the following:
    #psuedocode#

    ifmember group1
    if error level 1 goto next
    net use s: \\server\deptshare
    regedit /s \\server\folder\group1.reg
    :next
    ifmember group2
    if error level 1 goto next
    net use s: \\server\deptshare
    regedit /s \\server\folder\group2.reg
    :next
    ...
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.