Here is a copy of code I use for my customer to change the "My Computer" icon name to the name of the computer.Regards,
Brad
code:
;****************************************************************************************
:VARDEC
; Description:
; Declare some variable which will be used throughout the script.
;
; Input:
; None
;
; Output:
; Variables used throughout the program.
;****************************************************************************************
; Modification History
; Date Initials Description
;****************************************************************************************
;
Global $HKLM, $rsz, $machine, $HKLM_S
;
$HKLM="HKEY_LOCAL_MACHINE"
$HKLM_S="$HKLM\SOFTWARE\"
$rsz="REG_SZ"
$machine=@WKSTA
Return
;
;****************************************************************************************
:MYCOMPUTER
; Description:
; Change the name of the "My Computer" icon to be the computer name. This provides a
; quick method for one to determine the name of their computer.
;
; Input:
; $HKLM_S, $machine, $rsz
;
; Output:
; None
;****************************************************************************************
; Modification History
; Date Initials Description
;****************************************************************************************
;
Dim $keyclass, $keyroot, $temp, $returncode, $classname, $writname, $testvalue
$classname="'My Computer'"
$writname="computer name"
$testvalue=$machine
$keyclass="{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
$keyroot=$HKLM_S+"Classes\CLSID\"
Gosub WRITECLASS
Return
;
;****************************************************************************************
:WRITECLASS
; Description
; Tests a given class entry and changes it if it is not the desired value.
;
; Input:
; $keyroot, $keyclass, $testvalue, $rsz
;
; Output:
; None
;****************************************************************************************
; Modification History
; Date Initials Description
;****************************************************************************************
;
Dim $key, $temp, $returncode
$key=$keyroot+$keyclass
$temp=ReadValue($key,"") ; Reads the "(Default)" value at the key.
? "The "+$classname+" name in: "+$key
? "is: "+$temp
If $temp<>$testvalue
$returncode=WriteValue($key,"",$testvalue,$rsz)
If $returncode=0
? "The "+$testvalue+" was written to: "+$key
Else
? "There was an error writing the "+$testvalue+" to: "+$key
? "The error code is: "+$returncode
Endif
Endif
Return
;
;****************************************************************************************