# Need to Map drive with script



## gfxrelay (Oct 26, 2005)

I have setup a network connection between two computers. I need a script that will prompt the user for their network credentials and them map seven network drives from the one computer to the the other. Does any one know how to create such a script?


----------



## TheOutcaste (Aug 8, 2007)

Why not just set the network shares to be mapped when the user logs on? Each user can have different shares mapped.

Many questions if you need to use a script:


Do you need specific drive letters to be used, or just the first available letter?
Is there a chance that one of the shares may already be mapped?
Do you want to use that mapping, even if on a different letter?
Delete it and create a new one on correct letter?
If the desired letter is in use (User created a persistent map for example), how would you want to handle that?
Delete theirs (with or without a warning)?
Re-map theirs to a different letter(with or without a warning)?
Change your drive letter for your mapping?
Is the Username for the network share the same as the Username they log into Windows with?
Does the password have to be masked as they type it?
You can use a batch file that will ask them for the password once. It will be visible as they type it.
If you want the password masked, you can prompt them for the password for each share. The password will not be visible when they type it, but would have to be entered 7 times.
You can use a vbscript to ask for the password once and mask it as they type.

To use the vbscript you would need to change a security setting to allow local files to run a script, or they will get the "Blocked ActiveX" info bar, and have to "allow blocked content" each time.

Jerry


----------



## gfxrelay (Oct 26, 2005)

Hi thanks for the reply. I am trying to map folders temporarily over a VPN so clients can only connect to certain folders. I am trying to set it up so that they can work on their files and disconnect the mapped folders when they close the VPN


----------



## gfxrelay (Oct 26, 2005)

I managed to find a script that will more or less do what I want to do:

S&G VPN Drive Map
<HTA:APPLICATION
ApplicationName="MappingWithCredentials.HTA"
SingleInstance="Yes"
WindowsState="Normal"
Scroll="No"
Navigable="Yes"
MaximizeButton="No"
SysMenu="Yes"
Caption="Yes"
>





Your Username

 

@domain.com Password

 


​
Thanks for the help


----------



## TheOutcaste (Aug 8, 2007)

Your Welcome, though I didn't really help much. Thanks for posting the solution you found.

Jerry


----------

