MattNicholas
asked on
Delete a Registry Key containing specific words using a Login Script
Hi
We would like to use a login script to delete any registry keys called "BACKUP OF Default Outlook Profile".
The keys are located here
HKEY_CURRENT_USER\Software \Microsoft \Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\
Would anyone here have the code to perform this?
Bare in mind the "Default Outlook Profile" is also in here, so we only want to delete any keys with the word "BACKUP" in it.
I have attached a screenshot. The highlighted key is the one we would like to delete. There can be hundreds in here with the same name, but it will have numbers at the end. I.e BACKUP OF Default Outlook Profile 001.
Many thanks
regkey.bmp
We would like to use a login script to delete any registry keys called "BACKUP OF Default Outlook Profile".
The keys are located here
HKEY_CURRENT_USER\Software
Would anyone here have the code to perform this?
Bare in mind the "Default Outlook Profile" is also in here, so we only want to delete any keys with the word "BACKUP" in it.
I have attached a screenshot. The highlighted key is the one we would like to delete. There can be hundreds in here with the same name, but it will have numbers at the end. I.e BACKUP OF Default Outlook Profile 001.
Many thanks
regkey.bmp
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thank you Matt
for /f "tokens=1,2,3* delims=[" %%i in (RegTemp02.txt) do @echo [-%%i %%j %%k %%l >> DelRegKeys.reg
to:
for /f "delims=[" %%i in (RegTemp02.txt) do @echo [-%%i>> DelRegKeys.reg
It works better by eliminating blank space at the end of each line.