+ Post New Thread
Results 1 to 11 of 11
Windows Thread, Mapping a drive in Technical; I want to map a drive on a computer on another network, so it has a different domain, but it ...
  1. #1

    Edu-IT's Avatar
    Join Date
    Nov 2007
    Posts
    7,140
    Thank Post
    403
    Thanked 622 Times in 568 Posts
    Rep Power
    181

    Mapping a drive

    I want to map a drive on a computer on another network, so it has a different domain, but it has dual network cards so there's an IP for it on our range. I need to specify the details to connect to this drive rather than use my normal login credentials. Is there a script that can be run at logon to do this? Any pointers?

    I assume something like net use S: \\server\folder but how do I give the login details?

  2. #2

    tmcd35's Avatar
    Join Date
    Jul 2005
    Location
    Norfolk
    Posts
    5,665
    Thank Post
    850
    Thanked 893 Times in 738 Posts
    Blog Entries
    9
    Rep Power
    328
    Code:
    net use S: \\server\folder /user:domain\username /password:password
    should do it, see

    Code:
    net use /?
    for more details

  3. #3

    bladedanny's Avatar
    Join Date
    May 2009
    Location
    Sheffield
    Posts
    1,271
    Thank Post
    189
    Thanked 298 Times in 224 Posts
    Rep Power
    130
    It should be
    Code:
    net use s: \\server\share /user:domain\username password:password
    That should work.
    Last edited by bladedanny; 10th July 2013 at 08:12 AM.

  4. #4

    Edu-IT's Avatar
    Join Date
    Nov 2007
    Posts
    7,140
    Thank Post
    403
    Thanked 622 Times in 568 Posts
    Rep Power
    181
    As we have command prompt disabled though how can I get it to play happy? Atm I suspect it'll come up with 'command prompt disabled'.

    Edit: Ah, if I run it as a logon script, it might be different.
    Last edited by Edu-IT; 10th July 2013 at 08:24 AM.

  5. #5

    bladedanny's Avatar
    Join Date
    May 2009
    Location
    Sheffield
    Posts
    1,271
    Thank Post
    189
    Thanked 298 Times in 224 Posts
    Rep Power
    130
    If it's set as a logon script through GPO it should still run. CMD is disabled for our students but the mapped drives here still run.

  6. #6

    tmcd35's Avatar
    Join Date
    Jul 2005
    Location
    Norfolk
    Posts
    5,665
    Thank Post
    850
    Thanked 893 Times in 738 Posts
    Blog Entries
    9
    Rep Power
    328
    If it's for a single user (whose currently logged in) or a one off - you should be able to do it via the GUI. Windows should prompt for the username and password and their should be tick boxes to reapply at login and remember password.

    If it's a regular thing for all users then @bladedanny is right, put it in a logon.bat file.

  7. #7

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,765
    Thank Post
    3,274
    Thanked 1,053 Times in 974 Posts
    Rep Power
    365
    vbscript ?

    As per --> MapNetworkDrive | VBScript | SS64.com

    Code:
    Dim objNetwork, strUser, strPassword
    Set objNetwork = WScript.CreateObject("WScript.Network")
    strLocalDrive = "S:"
    strRemoteShare = "\\myserver\Directory" 
    strUser = "Domain\Username"
    strPassword = "MyPasswordHere"
    objNetwork.MapNetworkDrive strLocalDrive, strRemoteShare, False, strUser, strPassword
    False in the above command is to set if it is persistently mapped so if you need it to be persistent then just change this to True

    Although should do the same as the above mentioned bat file

  8. #8

    Edu-IT's Avatar
    Join Date
    Nov 2007
    Posts
    7,140
    Thank Post
    403
    Thanked 622 Times in 568 Posts
    Rep Power
    181
    I trued the BAT file option and placed it in scripts on Sysvol but it hung when the user tried to log in. Hmm?

    Tried just using this too in the hope it would pop up asking for auth but same thing.

    net use u: \\IP\share$

  9. #9

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,765
    Thank Post
    3,274
    Thanked 1,053 Times in 974 Posts
    Rep Power
    365
    The vb script any different or does that do the same ?

    Obviously open notepad, copy and paste code and adjust relevant bits ( domain\username, password, drive letter and the mapped path etc ), save as and in the filename text field when you are going to save it, type something along the lines of

    "MapDrive.vbs"

    Click Save and copy the script to the relevant sysvol area or wherever and assign as a logon script etc and try again

  10. #10

    Edu-IT's Avatar
    Join Date
    Nov 2007
    Posts
    7,140
    Thank Post
    403
    Thanked 622 Times in 568 Posts
    Rep Power
    181
    Spot on with the VBS :-)

    Thanks so much all.

  11. Thanks to Edu-IT from:

    mac_shinobi (10th July 2013)

  12. #11

    Edu-IT's Avatar
    Join Date
    Nov 2007
    Posts
    7,140
    Thank Post
    403
    Thanked 622 Times in 568 Posts
    Rep Power
    181
    Hmm. I want the drive to be available to multiple users but it seems to complain because the same credentials are being used by multiple people to map the drive. Any advice?

SHARE:
+ Post New Thread

Similar Threads

  1. Hide mapped network drives
    By timbo343 in forum Windows
    Replies: 11
    Last Post: 2nd April 2012, 09:06 AM
  2. Map network drives on wireless network
    By woody in forum Windows
    Replies: 24
    Last Post: 1st December 2007, 06:27 PM
  3. Map network drives
    By timbo343 in forum Scripts
    Replies: 7
    Last Post: 1st March 2007, 06:46 PM
  4. Mapped Network Drive with Redirected Folders
    By SpuffMonkey in forum How do you do....it?
    Replies: 5
    Last Post: 2nd November 2006, 05:23 PM
  5. mapping a drive to web folder in windows xp
    By russdev in forum Windows
    Replies: 1
    Last Post: 3rd October 2005, 08:31 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •