Discussion Locked

How to create mapping drives in Windows

0 helpful
17 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I tried to create mapping drives in Windows NT Server 4.0, but it would not recognize the commands. Please help. Below is a sample of my login script.

ECHO OFF
net use z: /delete
net use z: \\server\directory
net use y: /delete
net use y: \\server\directory
net use m: /delete
net use m: \\server\directory

if "%username%" = "tran_quang"
then net use o: \\server\Folder
end

if %member% = "it"
then net use o: \\server\Folder\Subfolder
end

17 replies

by mtnsqs

Check the permissions on the directories you are trying to map to.

Also try map to a know share name instead

by robert w.

stick a "pause" command into your batch file..that might help you in pin point where the pb is. Also, check your policy. Uncheck Remove the "Map Network Drive" and "Disconnect Network Drive options", uncheck Hide Network Neighborhood, and uncheck Hide Drives in My Computer. Those things gave me major headacks in the past.

by ravi

If you have set "No Access" permission on NET.EXE, you won't be abe to use the NET command. So, if the suggestions above are not working, you may want to check this.

Good luck.

by mrshawng

In your example, you are mapping to "\\server\directory" where "directory" should be a share on the server, if it isn't a share, that is one problem (same goes for the last net use, "Folder" has to be a share.).

The "if" statement requires two equal signs (if "%username%"=="tran_quang". Also, put the net use command on the same line with the if, and get rid of the "then" and "end" they aren't valid commands.

%member% is not a default variable. If you're checking the users group membership, try "ifmember.exe" it is a NT 4.0 resource kit utility.

REM out the ECHO OFF line so you can see what the script is trying to do, and then what it actually does. Put a pause at the end of the file, and if necessary at various points within.You can type the command and then /? to get information on how to use most of the NT command line programs.

Hope this helps.

by kellyst

time to buy an NT book, don't you think? You can map to shares not directories. Spend the 30 bucks and get a book.

by stephen_ski

As Kelly Quite rightly stated you cannot create drive mapping only share mappings...
take your folders apply permissions and then share them (for extra security apply NTFS permissions aswell) then apply your script

Also you may want to seriously consider a good book MaRK NAMINSKI`s book on NT4 is good

by tazz

Do not map to drive Z. I've read a technet article saying the netlogon pipe maps drive Z during logon (invisibly) and disconnects after logon. This is why you can use drive Z after logon (e.g. to connect Iomega ZIP-drive)
We had problems within a Kix script using drive Z. when we altered the drive mapping to Z it worked.

Good luck

by dbowlin

You must first share the folders you are mapping as drives. Also best not to use Z drive. Rather than deleting the mappings individually, you may want to try the following to delete all existing network resource mappings: net use * /delete /yes

This discussion is closed to new replies.