?
Solved

Deleting this reg entry with a VB script

Posted on 2008-10-24
2
Medium Priority
?
307 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
zabu99 earned 2000 total points
ID: 22799439
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
ID: 22799539
That worked Your the man!!!!
0

Featured Post

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Know what services you can and cannot, should and should not combine on your server.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

777 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