I am trying to map a drive for the client on Windows NT 4. Some users may already be mapped, if they are not then I will need to map them. Any suggestions?
Try using the windows scripting host
Here is an example
This will get the drives mapped on the client.
Set WshNetwork = CreateObject("WScript.Network"
Set clDrives = WshNetwork.EnumNetworkDrives ' for class of currently mapped drives
For i = 0 to clDrives.Count -1
string1= string1 & clDrives.Item(i)
Next
This will check if the drive you want to map is already mapped if not it will map it.
if instr(string1,"fa11na04" = 0 then
Set WshNetworkU = CreateObject("WScript.Network"
WshNetworkU.MapNetworkDrive "U", "\\fa11na04\Drive"
end if
Arguments object
WshNetwork object. strLocalName
String value indicating the name by which the mapped drive will be known locally. strRemoteName
String value indicating the share's UNC name (\\xxx\yyy). bUpdateProfile
Optional. Boolean value indicating whether the mapping information is stored in the current user's profile. If bUpdateProfile is supplied and has a value of true, the mapping is stored in the user profile (the default is false). strUser
Optional. String value indicating the user name. You must supply this argument if you are mapping a network drive using the credentials of someone other than the current user. strPassword
Optional. String value indicating the user password. You must supply this argument if you are mapping a network drive using the credentials of someone other than the current user.
Water is not bad as soon as it stays out human body ;-)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.