Page 1 of 1 1
Topic Options
#534 - 1999-09-28 10:02 PM Changin My Computer
Anonymous
Unregistered


Hi,

I am trying to add a section in my kix login script that takes the computer name and appends it to My Computer. This will allow the user to look in the top left corner and tell me his computer name. (ie My Computer ABC-123456) I have been trying to update the name through the registry but with no luck.

Thanks in advance

Top
#535 - 1999-09-29 12:46 AM Re: Changin My Computer
Anonymous
Unregistered


What does your kixscript section look like, and what key in registry do you change?

Top
#536 - 1999-09-29 07:38 AM Re: Changin My Computer
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
In Windows NT, the only way I can see to change the My Computer icon name is at...

HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D} = "My Computer ABC-123456"

After the change, you must point to your desktop and refresh it by hitting F5.

The only caveat here is that you will referencing a hard-coded CLSID. This might change in future releases.

As well, I'm not sure if you can affect changes to HKCR from within KIX. Might have to use a reskit tool. Plus, this is a global workstation setting, so insure you change it for every user that logs in.

Neat idea !

Shawn.

Top
#537 - 1999-09-29 08:48 AM Re: Changin My Computer
Anonymous
Unregistered


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
;
;****************************************************************************************


Top
#538 - 1999-09-29 08:52 AM Re: Changin My Computer
Anonymous
Unregistered


Oops,

Forget the $writname from the MYCOMPUTER subroutine. It was leftover from some testing.

Regards,

Brad

Top
#539 - 1999-09-30 12:06 AM Re: Changin My Computer
Anonymous
Unregistered


Brad,

Thanks, once I upgraded to 3.6 it seemed to work but, it does not change My Computer, the registry key is changed but the display is not. I logged off, no change. I restarted, no change.

Any suggestions?

Top
#540 - 1999-09-30 08:03 AM Re: Changin My Computer
Anonymous
Unregistered


I'm not sure why it hasn't changed. You could try to also write to:

$keyroot="HKEY_CLASSES_ROOT\CLSID\"

with the rest being the same. I'm not sure why you should have to since this is just a copy of the other key. Open regedit and check both locations. If the one above hasn't changed, add it into the script and call WRITECLASS a second time.

Hope that helps!

------------------
Regards,

Brad
Consultant
Net InfraStructure, Inc

Top
#541 - 1999-09-30 08:07 AM Re: Changin My Computer
Anonymous
Unregistered


Brad,

I am on NT, it worked on 9x! I created a new user logged in, and the icon was changed.

With that revelation I added some code to also write the change to the HKCU. Worked great!

I am in the process of testing with older versions of kix, when I get the results and the code cleaned up I will post it back here for everyone.

Thanks for your help!

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1095 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.057 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org