writing batch file for mapped network drive

BigGreg85

Gawd
Joined
Jun 19, 2003
Messages
910
Ok I set up a domain server, and mapped the folder. Im doing this so I can store all of my mp3s on 1 server and then shared them on my other PCs

I wrote this batch file and put it in the "netlogon" folder


@echo off

net use m: \\server\BigGreg's Music

pause


its simple....but it doesnt seem to work......what is wrong with this?


thank you
 
Originally posted by BigGreg85
Ok I set up a domain server, and mapped the folder. Im doing this so I can store all of my mp3s on 1 server and then shared them on my other PCs

I wrote this batch file and put it in the "netlogon" folder


@echo off

net use m: \\server\BigGreg's Music

pause


its simple....but it doesnt seem to work......what is wrong with this?


thank you

DOS doesn't understand spaces. Enclose the \\servername\sharename in double quotes (") or use the DOS 8.3 filename for the directory.

IE:

net use m: "\\server\BigGreg's Music"

or

net use m: \\server\BigGre~1
 
Ok I changed the batch file, now Im still having a problem....

when I login to the server, I cannot see the network drive.

I changed the user's "Environment Properties" in the AD to start logon.bat.


But Im still running into the same problem, any other suggestions?


Thank You
 
when i have trouble with batch files. i always add the line ping -t <any ip> so that i can see the commands as exceuted on the clients machine as well as any error.
 
You sure you have the script in the right SysVol?
We use VB scripts here at work and they rock.


--------------------------CODE---------------------------------------------------------
Option Explicit
Dim oNet, oSysInfo, sUserAdsPath
Dim oGroupList, oUser, oFSO, oShell

Set oNet = CreateObject("Wscript.Network")
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("Wscript.Shell")
Set oSysInfo = CreateObject("ADSystemInfo")
sUserAdsPath = oSysInfo.UserName

Set oUser = GetObject("LDAP://" & sUserAdsPath)
On Error Resume Next

'**************** Drive Mapping Area Start ******************

oNet.MapNetworkDrive "P:", "\\serverxxx\network1"
oNet.MapNetworkDrive "R:", "\\serverpb&j\network3"
oNet.MapNetworkDrive "X:", "\\10.5.1.7\setup"
oNet.MapNetworkDrive "Y:", "\\bananatime\fedchecks"

If IsMember(oUser, "mortgage") Then
oNet.MapNetworkDrive "M:", "\\serverxxx\mortgage"
End If

-------------------------END CODE------------------------------------------
I like the fact you can map by group membership too.
Give it a whirl. Works on our domain here like a champ.
 
Did you create accounts for your other PC's on your main computer? Are you using the right login/password with the connections? Are the folders shared with the proper permissions?
 
Back
Top