Jump to content

Mapping a drive using a domain account


Guest
 Share

Recommended Posts

I need to map a network drive using a domain account that has priveleges to that location.

Right now my script opens a command prompt and sends the following command:

net use b: /user:<domain>\<user> \\<server>\<folder>

After this is sends the enter command. The next step is for it to enter the password and send the enter command again. However, this script can be run over a vpn connection, so it may take a while to reach the server before it prompts for the password. Is there anyway to get it to wait until the password prompt shows and then have it enter the name instead of guessing with the sleep command?

Link to comment
Share on other sites

You could always ask the user for the information before hand with an inputbox, then

use something like

$MapReturn = DriveMapAdd("b:", "\\server\folder", 1, "domain\user", "Password")

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

You could always ask the user for the information before hand with an inputbox, then

use something like

$MapReturn = DriveMapAdd("b:", "\\server\folder", 1, "domain\user", "Password")

The idea is to have no user interaction. I just want to map the drive with the credentials hard coded into it.

Link to comment
Share on other sites

The idea is to have no user interaction. I just want to map the drive with the credentials hard coded into it.

then don't have user interaction, just fill in the info for the DriveMapAdd use it, should do what your wanting to do.

you can even do error checking to make sure it worked or not.

Might want to look at the link Drive Explorer, I used that also to map drives.

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...