Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1298
  • Last Modified:

Mapping network drive in login script

I need to know how to map network drive in login script and i need to map login user folder too.
0
Charlie1025
Asked:
Charlie1025
3 Solutions
 
KutyiCommented:
net use H: \\servername\sharename
0
 
EL-SHIMYCommented:
hi there
net use y: "\\Server-name\shared-folder" /persistent:yes
and if u u want to make it kinda dynamic up to login user
net use y: "\\Server-name\%UserName%" /persistent:yes
also
net use y:"\\<Server-name>\IPC$ "<PASSWORD>" /user:<USERNAME>

NET USE /?
NET HELP USE

put it on a file.txt and rename it ot file.cmd
and attach it to user or computer policy , or local script and start up programe

i hope that help :)
Shimy
0
 
JimsZCommented:
Create a .txt file and insert below lines.  Change your path, driveletters, etc.  Once complete, rename to a .vbs file


Dim objNetwork, strDriveLetter1, StrDriveLetter2
Dim strRemotePath1, strRemotePath2
Dim strnewname1, strnewname2


strDriveLetter1 = "Driveletter:" ' You need to change to drive letter such as F:
strDriveLetter2 = "Driveletter:" ' You need to change to drive letter such as G:

strRemotePath1 = "\\path1\pathfiles" ' You need to implement path to your share ex \\fileserver\share
strRemotePath2 = "\\path2\pathfiles" ' You need to implement path to your share ex \\fileserver2\share

strnewname1 = "Name of Share" ' You need to rename such as share1
strnewname2 = "Name of Share" ' You need to rename such as share2 (any name works

On Error Resume Next
Set objNetwork = WScript.CreateObject("WScript.Network")
objNetwork.MapNetworkDrive strDriveLetter1, strRemotePath1
objNetwork.MapNetworkDrive StrDriveLetter2, strRemotePath2

Set objShell = CreateObject("Shell.Application")
objShell.NameSpace(strDriveLetter1).Self.Name = strNewName1
objShell.NameSpace(strDriveLetter2).Self.Name = strNewName2
0
 
choswootCommented:
Rename .txt to a .vbs file when downloaded
Download Xcacls @:
http://www.microsoft.com/downloads/details.aspx?familyid=7a3e2241-d7d0-42b6-b86e-6eda88726c01&displaylang=en
This is an automated version with NTFS permission setting.
Set up the server configs and test directly from your desktop.
I'm assuming you know how to do the GPO, if not;
http://www.petri.co.il/setting-up-logon-script-through-gpo-windows-server-2008.htm

MAPDrv.txt
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now