/build/static/layout/Breadcrumb_cap_w.png

Script to change name of Computer icon on Windows 7 (seems to work for me)

I set it to the PC name but it could be anything you like.

Thought I may as well save other people a few hours of pain (or maybe I was just having a slow day).

Bits and pieces cut and pasted from various sources so I'm not claiming full credit or anything. :p

Let me know if it works for you.

-Johnny

' Create temp file with the script that regini.exe will use

set oFSO = CreateObject("Scripting.FileSystemObject")
strFileName = "C:\temp\computername.ini"
set oFile = oFSO.CreateTextFile(strFileName)
oFile.WriteLine "HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D} [1 5 7 11 17]"

oFile.Close

' Change registry permissions with regini.exe
'
set oShell = CreateObject("WScript.Shell")

wscript.echo "regini " & strFileName

oShell.Run "regini " & strFileName, 8, true

'oFSO.DeleteFile strFileName

Set wshNetwork = WScript.CreateObject( "WScript.Network" )
strComputerName = wshNetwork.ComputerName

wscript.echo """" & strComputerName & """"

HKEY_CURRENT_USER = &H80000001
strComputer = "."

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")

strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
strValueName = ""
strValue = strComputerName

oReg.SetExpandedStringValue _
HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

0 Comments   [ + ] Show comments

Answers (0)

Be the first to answer this question

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ