Jump to content
Compatible Support Forums
Sign in to follow this  
rgodart

how to make a reg file to automatically delete a string valu

Recommended Posts

Here's the thing. When i install autocad 2002 and i take a look in the add/remove program window, all the programs coming after autocad are placed waaaaaaaaaaaaaaay below the autocad entry. I mean there's a gap of 20 cm's.

 

I found a key in the registry to be the cause. When i delete that key everything is fine.

 

My question is: is it possible to make a reg file that will delete this key when i double click on it? So after a format i don't have to go into HKLM --> software --> microsoft --> windows --> currentversion --> uninstall (or something like that) just to remove that key. (it's a string value, if that matters)

 

 

Thanks

 

[edit]

 

Here's some more details. i exported the key to a reg file:

 

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{5783F2D7-0101-0409-0000-0060B0CE6BBA}]

"DisplayIcon"="C:\\Program Files\\AutoCAD 2002\\acad.exe,-1"

 

 

 

The problem is it tries to display an icon in the add/remove programs window, but fails, which makes a gap appear between that progam and the rest of the list.

Share this post


Link to post

Here's some examples from the registry files I added to an affinity program to add right-click functionality to pick which processor you wish to run the executable on!:

 

INSTALL

 

[HKEY_CLASSES_ROOT\exefile\shell\Affinity1]

@="Use CPU 1"

 

UNINSTALL

 

[-HKEY_CLASSES_ROOT\exefile\shell\Affinity1]

@="Use CPU 1"

 

See the difference? wink

Share this post


Link to post

The "@" symbol merely means "the unnamed (default) value".

 

It has nothing to do with the ability to delete keys from a .reg file.

 

Setting values to a blank string is not equivalent to deleting them.

Share this post


Link to post

The problem is, some [many] programs will respond differently to an empty value as opposed to a non-existant value.

 

If I read a REG_SZ from the registry and it's simply not there, the API call will respond differently than if I read it and it's been set to an empty string.

 

In the former case, I might use a default value -- but I probably won't put in a check to see if it's merely empty (it's reasonable to assume that if the value exists then it's meaningful, no?).

 

If the intent is to delete, then you should make certain to delete.

Share this post


Link to post

Just wanted to bump this up, as DosFreak's method works great for me. I am about to send out a regkey file to remove a dead key from several systems via SMS at work. Thanks for the tip!

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×