Deleting Registry Key + Current User

(imported topic written by carroll91)

I am running the following task to delete a registry key but receive a not relevant message when the job runs. The key actually exists in my HKCU. I am testing on my laptop with myself logged in. I am hoping someone can assist as I need to delete this key which is a Uesr DSN and replace it with a System DSN key in the HKLU. Thanks.

delete __appendfile

delete rescuelink.reg

appendfile Windows Registry Editor Version 5.00

appendfile

http://-HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC Data Sources\RescueLink

move __appendfile rescuelink.reg

prefetch RunAsCurrentUser.exe sha1:a72371f4e968da7ead24f0f4e68c14b234ac94f6 size:184320 http://software.bigfix.com/download/bes/util/RunAsCurrentUser-2.0.exe

utility __Download\RunAsCurrentUser.exe

waithidden __Download\RunAsCurrentUser.exe regedit /s rescuelink.reg

(imported comment written by BenKus)

You are saying the Fixlet is not relevant? If so, what is the relevance you are using?

Ben

(imported comment written by carroll91)

Ben,

After the action runs I get the message:

0 Applicable Computers

Status

Count

Percentage

1 targeted computer reported this action non-relevant.

My relevance in the task itself is:

(name of operating system = “Win2000” OR name of operating system = “WinXP” OR name of operating system = “WinXP-2003” OR name of operating system = “WinXPe” OR name of operating system = “Win2003” OR (name of it = “WinVista” and product type of it = nt workstation product type) of operating system OR (name of it = “Win2008” or (name of it = “WinVista” and product type of it != nt workstation product type)) of operating system OR name of operating system = “Win2008R2” OR name of operating system = “Win7”) AND (exists value “Rescuelink” of key “HKEY_USERS\S-1-5-18\Software\ODBC\ODBC.INI\ODBC Data Sources” of native registry)

Cheers,

Carroll.

(imported comment written by carroll91)

Ben I was able to resolve this. Here is the code anyone else having the same issue deleting ODBC User DSNs in the registry:

Relevance:

(exists x32 registry AND NOT exists x64 registry) AND (name of operating system = “WinXP” OR name of operating system = “WinXP-2003”) AND exists values “Rescuelink” of keys “Software\ODBC\ODBC.INI\ODBC Data Sources” of current user keys (logged on users) of registry

Action:

action uses wow64 redirection false

delete __createfile

delete deleterescuelink.reg

createfile until @end_create_reg_file

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC Data Sources]

“Rescuelink”=-

@end_create_reg_file

move __createfile deleterescuelink.reg

prefetch RunAsCurrentUser.exe sha1:a72371f4e968da7ead24f0f4e68c14b234ac94f6 size:184320 http://software.bigfix.com/download/bes … er-2.0.exe

utility __Download\RunAsCurrentUser.exe

waithidden __Download\RunAsCurrentUser.exe regedit /s deleterescuelink.reg

Cheers,

Carroll