Solved

Deleting this reg entry with a VB script

Posted on 2008-10-24
2
298 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
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to use wail2ban ?? 13 86
What is this Task? 4 87
Loading file name & last modified date of csv file in MySQL using data local infile 10 35
Import filename in batch 2 24
I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

895 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

13 Experts available now in Live!

Get 1:1 Help Now