Need a script to make this happen!

How can I script this so all users will have this regedit?

Change My Computer to the actual computer name and username. Open regedt32 and go to the HKEY_CLASSES_ROOT \CLSID{20D04FE0-3AEA-1069-A2D8-08002B30309D}
subkey. Copy the contents of the key's LocalizedString subkey (e.g., @C:\WINNT\system32\shell32.dll,-9216@1033,My Computer) to Notepad. Delete the LocalizedString subkey, then recreate it using the data type REG_EXPAND_SZ. Copy Notepad's contents into the new subkey, and change My Computer to %username% on %computername%.
kgbsdAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PanadminCommented:
This script will change the value for Windows 2000 or Windows XP. It needs to be run on any computer you want changed.
According to http://www.winguides.com/registry/display.php/370/, Windows XP or computers with IE 6.0 should just have a new key created with the desired value. Windows 2000 is changed as you describe.

'************************************************************
dim WshShell, oldName, newName
Set WshShell = WScript.CreateObject("WScript.Shell")

oldName = WshShell.RegRead("HKCR\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\LocalizedString")
WshShell.RegWrite "HKCR\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\LocalizedString.old", oldName, "REG_EXPAND_SZ"

'My Computer will be a part of the old value on Windows 2000 without IE 6.0.
if Instr(oldName, "My Computer") = 0 then
    newName = "%USERNAME% on %COMPUTERNAME%"
else
    newName = Replace(oldKey, "My Computer", "%USERNAME% on %COMPUTERNAME%")
end if

WshShell.RegWrite "HKCR\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\LocalizedString", newName, "REG_EXPAND_SZ"
'************************************************************
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kgbsdAuthor Commented:
We are almost all on IE 6.  For that I have found I need to do this:

If you are using Windows XP, or if Internet Explorer 6.0 is installed, the data value of the LocalizedString Value Name should only include the variables and text that you want. DO NOT include @%SystemRoot%\system32\shell32.dll,-9216@1033, in the string.

Would I just run this script in a .bat file?
Thanks.
0
PanadminCommented:
Good. The script above will handle that procedure.

Save the script as RenameMyComputer.vbs (or a name of your choice ending in .vbs) and then call it from a batch file using

cscript.exe RenameMyComputer.vbs

Include the path to the VBS file if it isn't in the same folder as the batch file.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 2000

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.