Solved

Deleting this reg entry with a VB script

Posted on 2008-10-24
2
297 Views
Last Modified: 2010-04-20
How can get this reg entry to update on its own. I always have to go in to reg and delete the values? Is the script I can use inside my login script to delete the values? This entry tells windows what label to give mapped drives. It never updates on it own and it is very frustrating.

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComputerDescription
0
Comment
Question by:Raquelfournier
2 Comments
 
LVL 5

Accepted Solution

by:
zabu99 earned 500 total points
Comment Utility
Here is a quick and dirty way of doing it. Delete the "ComputerDescription" key and then add it back in. Note: on my computer it is "ComputerDescriptions".

You could also enumerate each item in the key and delete them individually.

Nothing wrong with messing with the registry; if you have a backup. I would recommend exporting your registry before doing this. The script worked fine on my computer, but discretion is the better part of valor and all that...

Hope this helps. Let me know if you need more info or have questions.
'We could check to see if the key exists before deleting it,'

'or we could just add this line for expediency'

On Error Resume Next
 

'Set up variables and constants'

const HKEY_CURRENT_USER = &H80000001

strComputer = "."

strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ComputerDescription\"

 

'Connect to the registry'

Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 

	strComputer & "\root\default:StdRegProv")
 

'Delete'

objReg.DeleteKey HKEY_CURRENT_USER,strKeyPath

'Add'

objReg.CreateKey HKEY_CURRENT_USER,strKeyPath

Open in new window

0
 

Author Comment

by:Raquelfournier
Comment Utility
That worked Your the man!!!!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

762 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

9 Experts available now in Live!

Get 1:1 Help Now