#151781 - 2005-11-17 10:04 PM
Add a string to reg value.
|
brewdude6
Hey THIS is FUN
Registered: 2000-10-21
Posts: 280
Loc: Nashville, TN
|
Any thoughts on how check if a registry value is set...if so, I need to append to it with a string. Here is what I have so far.
Code:
$bbhome=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\16FD58773EE02F44F9082F014DAF6CC9", "6BB86DA5D449506409F1448FC6560289") If @error <> 0 ? "Error Encountered: " + @serror MessageBox("Can't find Big Brother install path!", $bbhome, 16) Exit 0 Else $bbexternals = ReadValue ("HKEY_LOCAL_MACHINE\SOFTWARE\Quest Software\BigBrother\bbnt\Externals","") If @error = 0 $bbfolder=$bbhome + "ext" $bbhomeext=";" + $bbfolder + " /INT=300" If Not Exist($bbfolder) MD $bbfolder $ = updateregistry("HKEY_LOCAL_MACHINE\SOFTWARE\Quest Software\BigBrother\bbnt\Externals","",$bbhomeext,"REG_SZ") Else ????? EndIf
_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs. -Mark Twain
|
|
Top
|
|
|
|
#151786 - 2005-11-18 12:13 AM
Re: Add a string to reg value.
|
brewdude6
Hey THIS is FUN
Registered: 2000-10-21
Posts: 280
Loc: Nashville, TN
|
Thanks Glenn.
I need to see if "$bbhomeext" is part of the string in "$bbexternals" and skip the writevalue section if it does.
Code:
$bbhome=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\16FD58773EE02F44F9082F014DAF6CC9", "6BB86DA5D449506409F1448FC6560289") If @error <> 0 ? "Error Encountered: " + @serror MessageBox("Can't find Big Brother install path!", $bbhome, 16) Exit 0 Else $bbexternals = ReadValue ("HKEY_LOCAL_MACHINE\SOFTWARE\Quest Software\BigBrother\bbnt\Externals","") If @error = 0 $bbfolder=$bbhome + "ext" $bbhomeext=";" + $bbfolder + "\" + "compaqhw.exe /INT=300" $bbhomeext1=$bbfolder + "\" + "compaqhw.exe /INT=300" If Not Exist($bbfolder) MD $bbfolder EndIf If $bbexternals $bbexternals=$bbexternals + $bbhomeext Else $bbexternals=$bbhomeext1 EndIf $ = WriteValue ("HKEY_LOCAL_MACHINE\SOFTWARE\Quest Software\BigBrother\bbnt\Externals","",$bbexternals,"REG_SZ")
I know I'm missing "endifs", but this is just a snippet.
_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs. -Mark Twain
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1179 anonymous users online.
|
|
|