If there is two scripts that I would like to use on a user's profile, do I seperate the scripts with a ";" or just a space between them?
Didn't we go through this already?
http://forum.osnn.net/showpost.php?p=800908&postcount=8
funny.. madmatt asked me the same question in an IM..With this setup, I will presume that I can create a different vbscript for each drive that I would like to map, would this be correct?
saving this file would be *.vbs, like in my situation it would be datadrive.vbs and specdrive.vbs, etc, etc?
basically, no - you don't create seperate scripts for each drive. The user account properties will only accept a single login script file (although, technically I suppose you could create seperate vbs files and call them through a bat file and have the bat file as your one login script.
But, generally, you'll wrap it into one file. You could remove the variables (strDriveLetter and strPath) and use the actual string values and write multiple connect lines like:
Code:objNetwork.MapNetworkDrive "y:","\\server\share1" objNetwork.MapNetworkDrive "z:","\\server\share2" . .
But you would have to wrap the lines to check each drive letter and disconnect the existing drive for each path if you wanted that functionality.
A better way would be to turn the mapping script section into a function/subroutine and call the function from the main script. Something along the lines of this:
Code:MapDrive "x:","\\192.168.25.103\c$" MapDrive "y:","\\192.168.25.103\e$" wscript.quit Function MapDrive(strDriveLetter,strPath) set objNet = CreateObject("Wscript.Network") set objFSO = CreateObject("Scripting.FileSystemObject") if not ( objFSO.DriveExists(strDriveLetter) ) then objNet.MapNetworkDrive strDriveLetter,strPath else set objDrive = objFSO.GetDrive(strDriveLetter) if not (objDrive.ShareName = strPath) then objNet.RemoveNetworkDrive strDriveLetter,true,true objNet.MapNetworkDrive strDriveLetter,strPath end if end if End Function