Compatible Support Forums: how to make a reg file to automatically delete a string valu

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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

#1 User is offline   rgodart 

  • enthusiast
  • Group: Members
  • Posts: 269
  • Joined: 06-February 01

Posted 03 October 2001 - 09:44 PM

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.
0

#2 User is offline   DosFreak 

  • Carpal Tunnel
  • Group: Moderators
  • Posts: 3885
  • Joined: 04-February 00

Posted 04 October 2001 - 12:20 PM

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
0

#3 User is offline   rgodart 

  • enthusiast
  • Group: Members
  • Posts: 269
  • Joined: 06-February 01

Posted 04 October 2001 - 04:42 PM

Thanks a lot! Exactly what i was looking for!
0

#4 User is offline   DrPizza 

  • newbie
  • Group: Members
  • Posts: 45
  • Joined: 01-March 01

Posted 08 October 2001 - 05:06 PM

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.
0

#5 User is offline   DrPizza 

  • newbie
  • Group: Members
  • Posts: 45
  • Joined: 01-March 01

Posted 08 October 2001 - 10:47 PM

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.
0

#6 User is offline   EddiE314 

  • Pooh-Bah
  • Group: Members
  • Posts: 1778
  • Joined: 18-January 00

Posted 09 October 2001 - 11:11 PM

DosFreak's method works flawlessly for me.
0

#7 User is offline   clutch 

  • Carpal Tunnel
  • Group: Moderators
  • Posts: 3859
  • Joined: 29-March 00

Posted 26 November 2001 - 09:58 AM

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!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users