If InGroup("Remote users")
Use x: /delete /persistent
Use x: "\\myserver\remote"
Label('x:\','my fancy new name')
EndIf
;DO NOT MODIFY ANYTHING BELOW THIS LINE.
;BELOW IS A UDF AND IT COME SREADY FOR USE.
;
;FUNCTION Label()
;
;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
;
;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)
$=CreateObject("shell.application")
If VarType($_s)
$.namespace(Left($_d,1)+":\").self.name=$_s
Exit @error
Else
$label = $.namespace(Left($_d,1)+":\").self.name
Exit @error
EndIf
EndFunction