Jump to content

Recommended Posts

Posted

I need help to use clean path or to remove filename from Registry value.

RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\BWMeter", "UninstallString")

In my case "UninstallString" is: C:\Program Files\BWMeter\Uninstall.exe
Posted (edited)

Uhm.. RegDelete?

No, because I'd like to use for other scripts, I need string to count chars until "\" or "\*2", and use converted string without filename for updates.

*Edit

Not to modify the Registry.

Edited by eJan
Posted

Wait... so you want to just pull the bolded part of the text from the RegRead?

Use StringInStr.

Offhand (not looking at the manual), I think it goes something like this:

$string = RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\BWMeter", "UninstallString")
$pos = StringInStr($string, '\', 0, -1)
$newstring = StringLeft($string, $pos)
msgbox(0, 'get path', $string & '=>' & $newstring)

My memory for syntax isn't perfect though.

Posted

Wait... so you want to just pull the bolded part of the text from the RegRead?

Use StringInStr.

Offhand (not looking at the manual), I think it goes something like this:

CODE$string = RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\BWMeter", "UninstallString")

$pos = StringInStr($string, '\', 0, -1)

$newstring = StringLeft($string, $pos)

msgbox(0, 'get path', $string & '=>' & $newstring)

My memory for syntax isn't perfect though.

Works great, thanks Saunders!

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
×
×
  • Create New...