Share via

Global Characters to Delete Registry keys with a .reg file

Ee 1 Reputation point
Jun 19, 2022, 4:25 AM
  I have a bug that I have had in every computer i have owned for over 15 years.  It involves the registry and I have been fixing it manually for over a decade. I have to fix it about once every few weeks. I want to write a .reg file to do it instead of me going into regedit and doing it manuall. The problem is that i need to know how to delete HUNDREDS of copied registry keys when the name is a duplicate of an existing name. The duplicate names all have a digit (or 6) and a + sign after the original name. This seems ot occur because the first key gets filled up to the 255 charcter limit.   

Can i use global characters in a .reg file to delete these data keys?
I have literaly THOUSANDS (most i ever saw was over 25,000 ) of them to delete and NO WAY to know how many without going in and looking manually.

BTW i have no idea what the "tags" below mean, sorry

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
12,078 questions
0 comments No comments
{count} votes

7 answers

Sort by: Most helpful
  1. EckiS 916 Reputation points
    Jun 20, 2022, 6:20 PM

    as a .reg file has no wildcards you will have to use something else.
    I would probably use powershell:
    working-with-registry-keys
    But it might be more effective to try to understand the bug and fix it?


  2. Ee 1 Reputation point
    Jun 20, 2022, 9:31 PM

    sorry typo, 15 years. not 1. there is avalue in the registry that get overwritten every time i open the close the options panel in Solidworks. This causes the value to double in length everytime i open then close the option. Not uncommon to have that key increase to tens of thousands of lines long. I reported the bug to Solidworks back in 2009 but they never did anythgin about it.

    0 comments No comments

  3. Limitless Technology 39,821 Reputation points
    Jun 21, 2022, 7:34 AM

    Hi Ee-5625,

    I suggest that you try PowerShell. Here is a command that should help you:

    Get-ChildItem -path HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall -Recurse | where { $_.Name -match 'xxx'} | Remove-Item -Force

    The reg path is specified and the search criteria goes where the xxx is in the above example.

    ----------------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept as answer--


  4. MotoX80 35,596 Reputation points
    Jun 22, 2022, 5:08 PM

    It is probably very relevant that i use a user name on my computers of only "E".

    That is unusual. Normally I would expect several characters, and it might explain why no one else has your problem.

    I found this.

    https://help.solidworks.com/2022/English/SWConnected/swdotworks/c_SOLIDWORKS_Journal_File.htm?format=P&value=

    It says:

    When you start SOLIDWORKS, it creates a journal file named swxJRNL.swj in the following location:
    C:\Users\current_user\AppData\Roaming\SOLIDWORKS\SOLIDWORKS version

    Do you see a swxJRNL.swj file in your C:\Users folders? Open a command prompt and search your C drive.

    dir c:\swxJRNL* /s /a  
    

    Have you tried setting that "SolidWorks Journal Folders" registry value to point to a C drive folder?

    "C:\Users\E\AppData\Roaming\SOLIDWORKS\SOLIDWORKS 2017"

    Be sure to create that folder too.

    Then run the app and verify that the swxJRNL.swj file was created in that folder and see if the registry value has changed or not.

    0 comments No comments

  5. Ee 1 Reputation point
    Jun 22, 2022, 7:40 PM

    I have had the journal file location set to c, d,e,f and g drives, always the same result. Yes i have seen the journal file where it should be. The location shown is the default location. I usually set it to my soildworks folder. but ether way the problem always happens. So far the only true fix i have come up with is to set the permission for the "\etx references" key so that the system and applications cannot write to it. That did work, but it keeps me from making changes to the options. My recent fix, and the original purpose of this post was that i want ( and did) to make a .reg file to delete all of the extra lines and write the correct info. I did that but had to use excel to create the text for 190,000 lines of text. I then copied and pasted that into my reg file. It works fine but seems like a dodge. But at least i dont have to go into regedit and fix it manually. You guys have been great and I do appreciate the help. I will try and diagnose some more to get more info.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.