Need a script to make this happen!

Posted on 2004-11-02
Last Modified: 2010-04-14
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%.
Question by:kgbsd
    LVL 2

    Accepted Solution

    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, 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%"
        newName = Replace(oldKey, "My Computer", "%USERNAME% on %COMPUTERNAME%")
    end if

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

    Author Comment

    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?
    LVL 2

    Expert Comment

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
    PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now