Unable to delete a registry key
Hi,
I've tried several things before coming here to ask this apparently simple question: how do I delete a registry (if it exists) using a script ?
The log always show me the following result:
This Windows 7 Professionnal 64 bits edition
Many thanks in advance for your help
I've tried several things before coming here to ask this apparently simple question: how do I delete a registry (if it exists) using a script ?
The log always show me the following result:
Running as: admin Checking if registry 'HKEY_LOCAL_MACHINE\Software\ODBC\ODBC.INI\' value 'test' does exist did not succeed: (2)You can see that the key I want to delete is seen, but I can't delete it.
This Windows 7 Professionnal 64 bits edition
Here is a screenshot from Kace:
Many thanks in advance for your help
0 Comments
[ + ] Show comments
Answers (4)
Please log in to answer
Posted by:
EdT
10 years ago
Posted by:
anonymous_9363
10 years ago
We have to assume you're talking about KBox scripting?
You're running 'As admin' which means that the script is going to run as the admin user or, more likely, as the local System account. If you need to test the profile for the logged-in user, you'll need to change the context in which the script runs. I can't tell you how to do that, as I know nothing about KBox scripting but I would imagine that the Help file would have that information.
You're running 'As admin' which means that the script is going to run as the admin user or, more likely, as the local System account. If you need to test the profile for the logged-in user, you'll need to change the context in which the script runs. I can't tell you how to do that, as I know nothing about KBox scripting but I would imagine that the Help file would have that information.
Comments:
-
Thanks for your response.
That's my only guess to do it, as we haven't received any sort of training... but if you have another suggestion to delete the keys I want to delete, do not hesitate to tell me how. - Yellow74 10 years ago
Posted by:
StockTrader
10 years ago
Hello,
you need to create an Online Kscript and then select one of these option to impersonate a particular user because HKCU exists in the user context only.
If you run as LocalSystem the HKCU is different from the user HCKU.
Every logged on user has his own HKCU.
Regards,
Stocktrader = Marco
Comments:
-
But the keys I want to delete I not under HKCU but under HKLM... I thought it would work with the local admin account... - Yellow74 10 years ago
-
So you make a check on the HKCU and a delete for a HKLM key?
May you edit your question adding some screenshots of the script's steps or posting the XML of the Script?
Kind regards,
Marco - StockTrader 10 years ago-
Done :) - Yellow74 10 years ago
-
So from the screenshot it seems that in the verify you are looking for a registry value but in the delete you want to delete a registry key...this may be the issue.
Regards,
Marco - StockTrader 10 years ago