Jump to content

Recommended Posts

Posted

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?

Posted (edited)

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.

Edited by Edu-IT
Posted

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.

Posted

vbscript ?

 

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

 

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 :)

Posted

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$

Posted

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

  • 2 months later...
Posted
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?

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



×
×
  • Create New...