Announcement

Collapse
No announcement yet.

net use - mapped drive

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • net use - mapped drive

    Hello,

    I am trying to write a bat file to help users reconnect to a mapped drive that sometimes does not reconnect at user login.

    Mapped drive is on server SV2
    Mapped drive letter is P
    password is the Administrator password
    Administrator is administrator name

    My bat file is:

    net use P: \\SV2\P password/Administrator

    Running this file does not re-connect the shared drive P:

    Any suggestions ? Thank you Alex

  • #2
    Re: net use - mapped drive

    This link has some comprehensive coverage of the command:

    http://pcsupport.about.com/od/comman...se-command.htm

    Check out your usage of the password and username.

    [Edit]
    You can use this as a startup item to map drive(s). Copy it into notepad and save with a .vbs extension.


    Option Explicit

    Dim WshNetwork, oDrives, i

    '-- Setting objects --
    Set WshNetwork = WScript.CreateObject("WScript.Network")
    Set oDrives = WshNetwork.EnumNetworkDrives

    DriveMapper "YourPreferredDriveLetter:", "\\ServerName\ShareName"

    Sub DriveMapper(Drive, Share)
    For i = 0 to oDrives.Count -1 Step 2
    if LCase(Drive) = LCase(oDrives.Item(i)) then
    if not LCase(Share) = LCase(oDrives.Item(i+1)) then
    WshNetwork.RemoveNetworkDrive Drive, true, true
    Else
    Exit Sub
    End if
    End if
    Next
    WshNetwork.MapNetworkDrive Drive, Share
    End Sub
    Last edited by Blood; 4th March 2014, 17:04.
    A recent poll suggests that 6 out of 7 dwarfs are not happy

    Comment


    • #3
      Re: net use - mapped drive

      Are you using GPO to run the script mapping the drive? You might need to look into your GPO issue. If the GPO applying to the client everytime user logon then it should work.

      I hate to hardcode user/password on the script. Its not good practice.

      If you want to give us a bit more overview on how you are mapping your network drives and we will see if we can help to figure out the issue.

      Comment


      • #4
        Re: net use - mapped drive

        Here is some additional info.

        Users login on the remote desktop server. They run the program on RDT server. Database is located on a different server (SV2) on a mapped drive
        P:
        Each RDT user has this mapped (P They are RDT users only ! Sometimes
        the P: drive does not re-connect

        Logged in as a RDT user, I went to the C prompt and I typed the follofing
        commends:

        net use P: \\192.168.5.67\p
        Enter the user name for '192.168.5.67': Administrator
        Enter the password for 192.168.5.67: *******
        System error 53 has occured

        The network path was not found

        If I ping the SV2 works just fine
        net use command gives me the following output

        net use

        Status Local Remote Network
        \\tsclient\P Microsoft Terminal Services
        OK \\SV2\IPC$ Microsoft Windows Network
        The command completed successfully

        Thank you





        Originally posted by alexandru1900 View Post
        Hello,

        I am trying to write a bat file to help users reconnect to a mapped drive that sometimes does not reconnect at user login.

        Mapped drive is on server SV2
        Mapped drive letter is P
        password is the Administrator password
        Administrator is administrator name

        My bat file is:

        net use P: \\SV2\P password/Administrator

        Running this file does not re-connect the shared drive P:

        Any suggestions ? Thank you Alex

        Comment


        • #5
          Re: net use - mapped drive

          are you mapped to the share folder? with proper permission?
          \\192.168.5.67\p is that a share folder "P"? is that share folder giving the appropriate permission to that user?

          Try this..
          Let say you want to share a folder called "P" on 192.168.5.67. to user called JPall.

          1. share the folder "P" to everyone or JPall with full control.
          2. On security setting. Give JPall modify or full access. Its depend on the need of that user.


          You can create a batch file called "mapping.bat"
          inside the file type
          NET USE P: \\192.168.5.67\p

          Put that file on startup folder or you can run it manually on user desktop.

          Give that a shot.

          Comment


          • #6
            Re: net use - mapped drive

            Originally posted by Humannetwork View Post
            are you mapped to the share folder? with proper permission?
            \\192.168.5.67\p is that a share folder "P"? is that share folder giving the appropriate permission to that user?

            Try this..
            Let say you want to share a folder called "P" on 192.168.5.67. to user called JPall.

            1. share the folder "P" to everyone or JPall with full control.
            2. On security setting. Give JPall modify or full access. Its depend on the need of that user.


            You can create a batch file called "mapping.bat"
            inside the file type
            NET USE P: \\192.168.5.67\p









            Put that file on startup folder or you can run it manually on user desktop.

            Give that a shot.


            P drive is shared, all users have FULL permissions. (required by the software we use)
            Done it, put in a bat file on user desktop ... not working is asking for
            username and password, (RDT users are NOT users on SV2)
            than I get system error 53 ...

            Comment


            • #7
              Re: net use - mapped drive

              I still think it has to do with your NTFS permission. I know you have told us that you did check the permission.

              Do us a favor just to test it out.

              1. Go to the Share folder (P). Properties, share tab, give the domain users group a full access permission.
              2. Go to the share folder (P). Properties, Security tab, give domain users full access to the folder.
              3. Turn off Windows Firewall on the share server (this shouldn't matter if the firewall is on. but just to isolate the issue, I think your issue is on step 1 and 2.)
              4. go to client computer. Make sure the P:\ is not in used by something else.
              5. open CMD from client computer. if the P:\ is not take then type
              NET USE P: \\192.168.5.67\p
              It should works. If P:\ is taken then replace with the drive letter that is not taken.

              once you confirm it works. You can use the batch file that you created earlier.

              Comment


              • #8
                Re: net use - mapped drive

                Have you already tried the 6 steps listed here: http://forum.synology.com/wiki/index..._network_drive


                /Rems

                This posting is provided "AS IS" with no warranties, and confers no rights.

                __________________

                ** Remember to give credit where credit's due **
                and leave Reputation Points for meaningful posts

                Comment

                Working...
                X