Steve,
I have a KiXtart script that does this in the login script. It works
for me on 95, 98, NT4, Win200 build 2195.
I can't attach files to this post, so I have pasted it below. Might be
pretty ugly re-formatting it, so let me know if you want it emailed to
you.
________________________________
GoTo "_Main"
;Last Modified=1999/12/29
;Last Modifier=Marty List
;Last Modification=Modified to support changes in Windows 2000
;===============================================================;
; ;
; This script renames the 'My Computer' icon on the desktop to ;
; the current Computer Name and IP Address. ;
; ;
; Please contact Marty List for any questions or changes. ;
; ;
;===============================================================;
;===============================================================;
:_Main If $Debug ? "========= Executing MyComputer.KiX. . .
==========" ? EndIf
;===============================================================;
If $AdminID = "" $AdminID = "JM18205" EndIf
If $AdminMachine = "" $AdminMachine = "IT-031" EndIf
$ExitCode = 13
$ExitFailed = 10
$ExitSuccess = 0
$FontDPI = 0
$IPTemp = ""
$IconSpacingKey = ""
$MinIconSpacing = ""
$MyComputerKey = ""
$MyComputerCLSID = "{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
$ResultCode = 0
$WindowsNT = 1
$Windows9x = 2
; Check for the IE4 integrated shell (Active Desktop), Win98, Win2000,
etc.:
Select
;=======================================================================
;
Case $Platform = $WindowsNT And $WinVer = "4.0"
;=======================================================================
;
; Check for the IE4 integrated shell (Active Desktop):
$ResultCode = ReadValue
("HKEY_LOCAL_MACHINE\Software\Microsoft\Active
Setup\InstallInfo", "Integrated Shell")
$MyComputerKey
= "HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID\"+$MyComputerCLSID
$IconSpacingKey = "HKEY_CURRENT_USER\Control
Panel\Desktop\WindowMetrics"
$MinIconSpacing = -1455
Else
$MyComputerKey
= "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\"+$MyComputerCLSID
$IconSpacingKey = "HKEY_CURRENT_USER\Control
Panel\Desktop"
; Icon spacing is different depending on 'Small Fonts'
or 'Large Fonts':
$FontDPI = ReadValue
("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows
NT\CurrentVersion\FontDPI", "LogPixels")
If Val($FontDPI) <= 60
$MinIconSpacing = 102
Else
$MinIconSpacing = 152
EndIf
EndIf
$IconSpacing = ReadValue($IconSpacingKey, "IconSpacing")
$IconSpacing = Val($IconSpacing)
If $IconSpacing >= $MinIconSpacing
$MinIconSpacing = 0
EndIf
;=======================================================================
;
Case $Platform = $WindowsNT And $WinVer = "5.0"
;=======================================================================
;
$MyComputerKey
= "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\
CLSID\"+$MyComputerCLSID
$IconSpacingKey = "HKEY_CURRENT_USER\Control
Panel\Desktop\WindowMetrics"
$MinIconSpacing = "-1530"
$IconSpacing = ReadValue($IconSpacingKey, "IconSpacing")
$IconSpacing = Val($IconSpacing)
If $IconSpacing <= $MinIconSpacing
$MinIconSpacing = 0
EndIf
;=======================================================================
;
Case $Platform = $Windows9x And $WinVer = "4.0"
;=======================================================================
;
;=======================================================================
;
Case $Platform = $Windows9x And $WinVer = "4.10"
;=======================================================================
;
;=======================================================================
;
Case 1 ;Default, Case Else:
;=======================================================================
;
$Message = "WARNING: MyComputer.KiX failed to find an OS
definition"
Call $ScriptDir+"\NotifyAdmin.KiX"
$ExitCode = $ExitFailed
;=======================================================================
;
EndSelect
;=======================================================================
;
If $Debug
? "$$MyComputerKey: ["+$MyComputerKey+"]"
? "$$IconSpacingKey: ["+$IconSpacingKey+"]"
? "$$IconSpacing: ["+$IconSpacing+"]"
? "$$MinIconSpacing: ["+$MinIconSpacing+"]"
EndIf
If $NewMyCompName = ""
If $IPAddressTrim = ""
If $Debug ? "$$Location="+$Location+",
$$Connection="+$Connection+" - calling GetLocation.KiX" EndIf
Call $ScriptDir+"\GetLocation.KiX"
EndIf
If $IPAddressTrim
Else
$Message = "WARNING: MyComputer.KiX failed to resolve
$$IPAddressTrim from GetLocation.KiX"
GoSub "_Notify"
$ExitCode = $ExitFailed
EndIf
EndIf
If $Debug ? "$$NewMyCompName: ["+$NewMyCompName+"]" EndIf
;? "Renaming the My Computer icon to $NewMyCompName..." ?
$ResultCode = AddKey("$MyComputerKey")
$ResultCode = WriteValue
("$MyComputerKey", "", "$NewMyCompName", "REG_SZ")
If $ResultCode = 0
If $MinIconSpacing <> 0
$ResultCode = WriteValue
("$IconSpacingKey", "IconSpacing", "$MinIconSpacing", "REG_SZ")
If $ResultCode <> 0
$ExitCode = $ExitFailed
$Message = "WARNING: MyComputer.KiX failed,
WriteValue("+$IconSpacingKey+", IconSpacing, "+$MinIconSpacing+")
returned "+$ResultCode
GoSub "_Notify"
EndIf
EndIf
Else
$ExitCode = $ExitFailed
$Message = "WARNING: MyComputer.KiX failed, WriteValue
("+$MyComputerKey+", , "+$NewMyCompName+") returned "+$ResultCode
GoSub "_Notify"
EndIf
If $ExitCode <> $ExitFailed
$ExitCode = $ExitSuccess
EndIf
GoTo "_Exit"
;===============================================================;
;===============================================================;
:_Notify If $Debug ? "========== Entering _Notify
==========" ? EndIf
;===============================================================;
If $Message = ""
$Message = "WARNING: MyComputer.KiX failed and then called
_Notify() with an empty $$Message variable"
EndIf
If Exist($ScriptDir+"\NotifyAdmin.KiX")
Call $ScriptDir+"\NotifyAdmin.KiX"
Else
$ResultCode = SendMessage($AdminMachine, $Message)
If $ResultCode <> 0 $ResultCode = SendMessage($AdminID,
$Message) EndIf
EndIf
$Message = ""
Return
;===============================================================;
;===============================================================;
;===============================================================;
:_Exit If $Debug ? "========= Exiting MyComputer.KiX with
$$ExitCode "+$ExitCode+". . . ==========" ? EndIf
;===============================================================;
;===============================================================;
Exit $ExitCode
________________________________
Quote:
> Using either SMS or Login Script, I would like to change the caption
of the
> My Computer Icon to state the Network Name of the local computer.
> If anyone has done this, could you please advise.
> Thank You,
> Steve BerkHolz
Sent via Deja.com http://www.deja.com/
Before you buy.