Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logon scripts

Status
Not open for further replies.

tpluskota

Technical User
Dec 11, 2002
121
0
0
GB
This is probably really easy but I just can't get it..

I use logon scripts for all users as follows

net use i:\ server\share

This has worked fine however I recently moved load of data onto a new server, I updated the logon scripts to point to the new server no problem with the Windows 98 machines but the XP's will not pick up the new mapping unless I map a drive manually.

Is there a disconect drive command I can put into the script to solve this problem or any other fix??

Thanks
 
net use /DELETE

if the XP machines had staic mappings to the old server that would give you trouble.
 
you may also want to turn off persistence

net use ? \\server\share /persistent:no

this has changed from nt to 2k, it used to be that persistent was "no" by default, no it's "yes"

jared
 
IMO batch files are the old way of doing things. I map all of our drives using vb code. I have posted a couple of sites for you to check out. You will find that for xp and 2000 scripting works better with vb. Let me know if these sites help.
' Begin code for simplemap.vbs
' Downloaded from the Scripting Guide for Windows
' /scripting/
' Version: 1.0 (November 23, 2000)

Dim WSHNetwork
Set WSHNetwork = WScript.CreateObject("WScript.Network")

WSHNetwork.MapNetworkDrive "S:", "\\server\share"

' End code

 
from a security standpoint, vb is evil and WSH should be locked down on user workstations as it is the engine for every virus known.

but that's IMO :)
 
really dumb question I'm sure, but why do you use net use at logon to map a drive? here at the office I just mapped the drive and hit connect on next logon or something like that.
 
net use x: /DELETE will remove a drive and when you remap like Jared71 said turn off persistence. If you use vbscript you will might want to check if the connection already exists and disconnect. Otherwise, in your case, your drive is already persistent and would cause an error.
 
"why do you use net use at logon to map a drive?"

It gives you central administration. If you have 2000 users and you change the name of your file server so only need to modify the login script, rather than changing 2000 workstations :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top