+ Post New Thread
Results 1 to 5 of 5
Windows Thread, Batch file to map network drive in Technical; I would like to create a batch file to map a Windows share as a network drive, and need to ...
  1. #1

    Join Date
    Jan 2007
    Posts
    989
    Thank Post
    14
    Thanked 48 Times in 28 Posts
    Rep Power
    25

    Batch file to map network drive

    I would like to create a batch file to map a Windows share as a network drive, and need to provide a set of login credentials and set it so 'Remember my password' is enabled.

    Any way to do this through a batch file?

  2. #2
    soveryapt's Avatar
    Join Date
    Jan 2009
    Location
    Lancashire
    Posts
    2,421
    Thank Post
    656
    Thanked 278 Times in 245 Posts
    Rep Power
    78
    What kind of setup are you using?

    My first thought would be the easiest thing it to make sure that the permissions on the share are set so that those people you want to access it can access it without having to input their credentials and then use the old:

    net use <drive letter>: \\servername\pathtoshare

    in a batch file and stick it in your startup folder or get it to run as a login script ..

    I have a number of shares pushed out via login script (which also does a quick reset of the drive maps first just in case) on 2003R2, and shares such as staff ones are accessible to staff but not pupils etc, by using groups in the security


  3. #3
    ahuxham's Avatar
    Join Date
    Apr 2008
    Posts
    1,122
    Thank Post
    76
    Thanked 138 Times in 109 Posts
    Rep Power
    31
    net use would work for anyone logged in and use those credentials, however the blurb about remember credentials.

    Are you trying to map this network drive under a different account other than the logging in one? You can specify username to mount the drive.

    net use Z: \\server\folder /user:user@domain (leave the password out to be prompted, however not entirely sure if you can have it remember the password, you could add the username and password in the key store application and associate it to net use?

    Bit of google. Knew it was rundll32.exe keyMGR. However here is the command to open stored usernames and passwords:

    rundll32.exe keymgr.dll,KRShowKeyMgr

    Add a new username/password combo for the specified server and you should be golden.
    Last edited by ahuxham; 22nd October 2009 at 02:06 PM.

  4. #4

    Join Date
    Jan 2007
    Posts
    989
    Thank Post
    14
    Thanked 48 Times in 28 Posts
    Rep Power
    25
    Quote Originally Posted by aptproductions View Post
    What kind of setup are you using?

    My first thought would be the easiest thing it to make sure that the permissions on the share are set so that those people you want to access it can access it without having to input their credentials and then use the old:

    net use <drive letter>: \\servername\pathtoshare

    in a batch file and stick it in your startup folder or get it to run as a login script ..

    I have a number of shares pushed out via login script (which also does a quick reset of the drive maps first just in case) on 2003R2, and shares such as staff ones are accessible to staff but not pupils etc, by using groups in the security

    The problem is we use Novell (i.e. no AD) so the share is on a standalone Windows 2003 Server.

    We use the share for some staff so they can write images etc to it, but now we have a new system in place where some staff need to view these photos but not modify anything in the shared folder.

    So I was hoping to create the secondary 'read only' user and then stick a batch file on the network so staff can run it when they need to to map and store the network drive mapping with the correct user credentials stored.

  5. #5
    ahuxham's Avatar
    Join Date
    Apr 2008
    Posts
    1,122
    Thank Post
    76
    Thanked 138 Times in 109 Posts
    Rep Power
    31
    Quote Originally Posted by googlemad View Post
    The problem is we use Novell (i.e. no AD) so the share is on a standalone Windows 2003 Server.

    We use the share for some staff so they can write images etc to it, but now we have a new system in place where some staff need to view these photos but not modify anything in the shared folder.

    So I was hoping to create the secondary 'read only' user and then stick a batch file on the network so staff can run it when they need to to map and store the network drive mapping with the correct user credentials stored.
    Read my post

SHARE:
+ Post New Thread

Similar Threads

  1. Script to map drive by OU
    By cookie_monster in forum Scripts
    Replies: 1
    Last Post: 12th October 2009, 09:02 PM
  2. Map Network drive dependant on Comp OU
    By buzzard in forum Scripts
    Replies: 1
    Last Post: 13th August 2009, 03:45 PM
  3. Replies: 2
    Last Post: 3rd March 2009, 11:37 AM
  4. run a batch file on logon with a CC3 Network
    By new-2-this in forum How do you do....it?
    Replies: 5
    Last Post: 17th July 2008, 07:57 PM
  5. Map FTP as Drive?
    By Samson in forum Scripts
    Replies: 1
    Last Post: 2nd July 2007, 08:34 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
  •