Jump to content

Recommended Posts

Posted

Hi there,

 

I have a variable that gets the Windows theme DisplayName successfully. The variable is $idDisplayName and the text could be a theme name in all text such as:

Windows spotlight

Glow

Or it could also contain a DLL resource identifier such as:

@%SystemRoot%\System32\themeui.dll,-2114

@%SystemRoot%\System32\themeui.dll,-2060

I already have a method to obtain the DisplayName base on those resource identifiers.

The part where I am stuck right now is I want to continue the function if $idDisplayName only contains text characters. But if $idDisplayName contains the @ symbol, I want to move to another function to parse the DisplayName.

Rough example:

If $idDisplayName contains @
Then

strip everything except for the resource number only, no characters or minus symbol

So for example, if $idDisplayName contains the @ symbol, I want the following:

@%SystemRoot%\System32\themeui.dll,-2114

To simply return into another variable as:

2114

This way I can move onto my other function that I already have functioning to obtain the resource identifier string (DisplayName) based on that number.

I am guessing that this may require regex, but either way I am stuck on this part.

Thank you for your time.

Posted

@Andreik Thank you for leading me in the right direction. I used StringInStr to determine whether DisplayName had an @ symbol or not. Then I used StringRight to grab the 4 digits on the right. Everything works now. I appreciate it.

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
  • Recently Browsing   0 members

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