Jump to content

Modify registry entry within a unique registry key


jafo2010
 Share

Recommended Posts

I hope someone can help with my problem, Im trying to modify a registry value that contains a key which ends with a unique identifier for each computer.

Example:

HKEY_USERS\S-1-5-21-1617767100-1661673603-930774774-?????\Software\

The first 41 characters after HKEY_USERS are always identical on every machine, the last 5 characters are always unique on every machine. How would I go about reading the first portion to find the ending 5 digits so that I can modify keys beyond the unique key name? Ive tried wildcards but it doesnt seem to work, or perhaps Im using them incorrectly.

Link to comment
Share on other sites

I hope someone can help with my problem, Im trying to modify a registry value that contains a key which ends with a unique identifier for each computer.

Example:

HKEY_USERS\S-1-5-21-1617767100-1661673603-930774774-?????\Software\

The first 41 characters after HKEY_USERS are always identical on every machine, the last 5 characters are always unique on every machine. How would I go about reading the first portion to find the ending 5 digits so that I can modify keys beyond the unique key name? Ive tried wildcards but it doesnt seem to work, or perhaps Im using them incorrectly.

There is a reason for that.

Can't you just modify the same value under HKEY_CURRENT_USER?

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

There is a reason for that.

Can't you just modify the same value under HKEY_CURRENT_USER?

Unfortunately I need this setting to be passed to all users not just the current user, also this will be done remotely and multiple users will log onto these systems.

Link to comment
Share on other sites

I hope someone can help with my problem, Im trying to modify a registry value that contains a key which ends with a unique identifier for each computer.

Example:

HKEY_USERS\S-1-5-21-1617767100-1661673603-930774774-?????\Software\

The first 41 characters after HKEY_USERS are always identical on every machine, the last 5 characters are always unique on every machine. How would I go about reading the first portion to find the ending 5 digits so that I can modify keys beyond the unique key name? Ive tried wildcards but it doesnt seem to work, or perhaps Im using them incorrectly.

try using stringsplit command
Link to comment
Share on other sites

I solved the problem which I will post here in case anyone needs something similar.

It's not pretty, but it works.

For $i= 1 to 10
    $var = RegEnumKey("HKEY_USERS", $i)
    If @error <> 0 then ExitLoop
    If $var >= "S-1-5-21-1617767100-1661673603-930774774-" Then
        RegDelete("HKEY_USERS\" & $var & "Software\PATH OF YOUR CHOICE")
    EndIf

Next
Link to comment
Share on other sites

I hope someone can help with my problem, Im trying to modify a registry value that contains a key which ends with a unique identifier for each computer.

Example:

HKEY_USERS\S-1-5-21-1617767100-1661673603-930774774-?????\Software\

The first 41 characters after HKEY_USERS are always identical on every machine, the last 5 characters are always unique on every machine. How would I go about reading the first portion to find the ending 5 digits so that I can modify keys beyond the unique key name? Ive tried wildcards but it doesnt seem to work, or perhaps Im using them incorrectly.

An oldie but goodie, from a scripter who's the same: _RegSearch()

$avResults = _RegSearch("HKU\", "S-1-5-21-1617767100-1661673603-930774774-", 1, True)

:mellow:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...