I placed this script in the logon directory of a win2000 server , so when I
log with the win98 machine it fails at startup because of the
onet.username. But when I am logged I can execute this same script and it
works well.
What's the problem?
It seems the onet.username variable doesn't exist before the user is
connected.
Thanks for response.
dim oNet
set oNet = createobject("wscript.network")
enleve_lecteur "Y:"
oNet.mapnetworkdrive "Y:" , "\\svr_hwt\" & oNet.username & "$" , true
sub enleve_lecteur(lettre)
set oDrive = oNet.enumNetworkDrives
for i=0 to (oDrive.count -2) step 2
if oDrive(i)=lettre then
oNet.RemoveNetworkDrive lettre , true , true
end if
next
end sub