#113789 - 2004-02-11 02:08 PM
mapdrives and labels - UDFs of interest
|
Lonkero
KiX Master Guru
   
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
k, first will list the UDF's that are discussed herein: http://www.gwspikval.com/jooel/UDF/udf/82377.htm (mapdrive by Radimus) http://www.gwspikval.com/jooel/UDF/udf/82133.htm (mapdrive by Sealeopard) http://www.gwspikval.com/jooel/UDF/udf/83113.htm (label by Lonkero) http://www.gwspikval.com/jooel/UDF/udf/82999.htm (changeDriveLabels by MightyR1)
now, there is nothing wrong in the mapping side, so if you was here for that, you can leave. I have problems with the label side and didn't want to keep on talking at the UDF forum.
now, background is that we all have had success with about all of these. and also that none of these work properly and trustworthy during logon.
I have a theory that the label way Sealeopard and MightyR1 have are bound to succeed only after second logon. this theory based on the fact that neither their nor my own registry-based labelling way's succeeded on even 1 drive rigth out of box. after many runs the drive's started labelling properly.
then the other branch, mapdrive by radimus and my label. these tend to fail forever. or then randomly succeed.
I have had about 20 different label() code's and realized that none of them work. and the nice part is that if you add a debug check in it, like query back the label, it is correct. with both ways all drive-labels succeed but after you are fully logged on, the label's are gone.
I am currently investigating a way to make it fully trustable on my devel-logonscript but if someone of you has any insight, I will wellcome it.
_________________________
!download KiXnet
|
|
Top
|
|
|
|
#113790 - 2004-02-11 03:11 PM
Re: mapdrives and labels - UDFs of interest
|
Lonkero
KiX Master Guru
   
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
k, did some testing.
waiting for windows to update the reg first and then doing the change helped.
I have 1 drive that times out of the 2s bound but all others do hit the mark around 0,1-1,5s
;FUNCTION Label (version 1.2)
;
;AUTHOR Lonkero
;
;ACTION Read and Write Drive Label
;
;SYNTAX Label("DRIVE","LABEL")
;
;PARAMETERS
; DRIVE
; - drive to rename
; LABEL
; - new name of the drive
; to read the label, leave out
;
;RETURNS
; nothing on write.
; on read the current label.
; check @error for possible errors
;
;DEPENDENCIES
; Minimum operating systems: Windows 2000/ME
; COMerror UDF
;
;EXAMPLE
; "Current Label for C: is:"
; Label('c:')
; ? "Changing it..."
; Label('c:\','my fancy new name')
; if @error
; ? "ERROR OCCURED:" @serror
; else
; ? "New Label for C: is:"
; Label('c:')
; endif
;
;CODE
function label($_d,optional $_s)
dim $,$_l
$_l=left($_d,1)
$=createobject("shell.application")
if vartype($_s)
$_d=0
do
sleep 0.1
$_d=$_d+1
until $_d>20 or 1=readvalue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\_Notif",$_l)
$.namespace($_l+":\").self.name=$_s
exit COMerror(@error)
else
$label = $.namespace(left($_l,1)+":\").self.name
exit COMerror(@error)
endif
endfunction
_________________________
!download KiXnet
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1046 anonymous users online.
|
|
|