My application is related to Add-In. I want to delete a registry value data from Current User.

First I will say the scenario of my application.
I have installed one add-in application then it is creating one current user entry ie.,.HKCU\Software\Microsoft\Office\11.0\Excel\Options Open="Path of .xla file".
After this I installed my application then it is creating one current user entry ie,.
HKCU\Software\Microsoft\Office\11.0\Excel\Options Open1="Path of my application .xla file".

During uninstallation I need to delete only Path of .xla file not Open. Because We dont know how many Add-In applications are installed before installing my application.


So I need a script to delele Data in Registy Key.ie,. Path of .xla file.
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
Hopefully this will help you:

Const HKEY_CURRENT_USER = &H80000001
strComputer = "."

Set objRegistry=GetObject("winmgmts:\\" & _
strComputer & "\root\default:StdRegProv")

strKeyPath = "Software\Test"
strValueName = "Sample Value 1"
objRegistry.DeleteValue HKEY_CURRENT_USER, strKeyPath, strValueName

Also got to this website and download the archives... Very handy for reference:
http://www.microsoft.com/technet/scriptcenter/resources/qanda/hsgarch.mspx
Answered 11/19/2008 by: volantedesktop
Senior Yellow Belt

Please log in to comment
0
Thank u for ur reply.

I used this script but it is deleting the Open (Stringvalue). But I want to delete only data in Open.ie,.C:\ProgramFiles\Panopticon\abc.xla

Name Type Data
Open REZ_SZ C:\ProgramFiles\Panopticon\abc.xla

Could U just give me the solution for this.
Answered 11/19/2008 by: sanhivi
Second Degree Green Belt

Please log in to comment
0
No, no, no, no, NO! NEVER use the 'Open' value when dealing with XL add-ins, and you should certainly avoid hard-coded Office versions in script. Use XL's Automation to add and remove its add-ins. Search *this* forum for 'Excel' and 'add-in' and you'll find examples. Or, if all else fails, there's a search thingy called 'Google' which is proving quiote popular these days.

Now, what on earth does this:
ORIGINAL: sanhivi
Name Type Data
Open REZ_SZ C:\ProgramFiles\Panopticon\abc.xla
mean? That isn't a script. What is it?

Also, why on earth do you want to remove only the data in that entry? I could understand if you wanted to replace it. If you leave it there with no data and the user subsequently adds another add-in, XL is going to become confused, as will the user when he opens the add-ins menu and sees a blank entry in his list of available add-ins.
Answered 11/20/2008 by: VBScab
Red Belt

Please log in to comment
0
Hi we can also do this way. Import the registry key you wanted to delete and save it as xyz.reg and edit the the registry key by adding '-' for example
[-HKEY_CURRENT_USER\Software\xyz]

add command

regedit.exe /s xyz.reg

Does the work for you.

Regards,
Ram.
Answered 11/24/2008 by: Ram
Senior Purple Belt

Please log in to comment
0
ORIGINAL: Ram
Does the work for you.
...yeh, except it's not the work which the OP wants. Your method deletes the entire key, whereas the OP wants (for some bizarre reason) to remove the entry's data.
Answered 11/25/2008 by: VBScab
Red Belt

Please log in to comment
0
Hi,
try this....

use wise script editor
go to edit registry
Add a registry key under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components
create a new stubpath
and create a new value
reg.exe delete "HKCU REGISTRY PATH" /v /F
Answered 12/09/2008 by: ratheeshtravi
Yellow Belt

Please log in to comment
0
...which, just like the previous example, deletes the value. The OP wants - for reasons I am unable to fathom - to delete the value's data.
Answered 12/09/2008 by: VBScab
Red Belt

Please log in to comment
0
Set Sh = CreateObject("WScript.Shell")
key = "HKEY_CURRENT_USER\"
Sh.RegWrite key & "Software\Microsoft\Office\11.0\Excel\Options\Open", ""

Try the above one. is this are you looking for ...
Answered 12/09/2008 by: sayeenath@gmail.com
Yellow Belt

Please log in to comment
0
Set Sh = CreateObject("WScript.Shell")
key = "HKEY_CURRENT_USER\"
Sh.RegWrite key & "Software\Microsoft\Office\11.0\Excel\Options\Open", ""
Again, a hard-coded Office version number (BAD idea) and an assumption that the add-in is in the first position (add-ins are referenced as 'Open' for the first, 'Open1' for the second, 'Open2' for the third and so on.
Answered 12/09/2008 by: VBScab
Red Belt

Please log in to comment
0
Hi,
don't know if you have already a solution.
The simpliest way is to use REG ADD in the following way.

REG ADD "HKCU\Software\Microsoft\Office\11.0\Excel\Options" /V "Open1" /T REG_SZ /F

So the existing entry will be overwritten with an empty value.
Answered 01/30/2009 by: OriginalM
Senior Yellow Belt

Please log in to comment
0
REG ADD "HKCU\Software\Microsoft\Office\11.0\Excel\Options" /V "Open1" /T REG_SZ /F Aaaaaaaaaaand, yet again, a hard-coded Office version number (BAD idea) and an assumption that the add-in is in the first position (add-ins are referenced as 'Open' for the first, 'Open1' for the second, 'Open2' for the third and so on. )
Answered 01/30/2009 by: VBScab
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity