Page 1 of 1 1
Topic Options
#204531 - 2012-03-21 02:50 AM SetOption("WOW64AlternateRegView", "ON")
KIXKicks Offline
Starting to like KiXtart

Registered: 2002-07-26
Posts: 177
Loc: Vancouver, WA
Using this in script, it echos ON or OFF (depending on the value of the command) on the screen. Is there a way to turn it off or customize the echo?

 Code:
SetOption("WOW64AlternateRegView", "ON")
$READREG = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Websense\Agent", "InstallPath")
SetOption("WOW64AlternateRegView", "OFF")

"WEBSENSE ENDPOINT [DIR]: " + $READREG


Returns:
OFFONWEBSENSE ENDPOINT [DIR]: C:\Program Files\Websense


Rather have nothing or something like:
WOW64AlternateRegView = OFF
WEBSENSE ENDPOINT [DIR]: C:\Program Files\Websense
WOW64AlternateRegView = ON

Top
#204532 - 2012-03-21 02:58 AM Re: SetOption("WOW64AlternateRegView", "ON") [Re: KIXKicks]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
$RC=SetOption("WOW64AlternateRegView", "OFF")
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#204533 - 2012-03-21 03:04 AM Re: SetOption("WOW64AlternateRegView", "ON") [Re: Les]
KIXKicks Offline
Starting to like KiXtart

Registered: 2002-07-26
Posts: 177
Loc: Vancouver, WA
Thanks, but does it execute it?
Top
#204534 - 2012-03-21 03:57 AM Re: SetOption("WOW64AlternateRegView", "ON") [Re: KIXKicks]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Yes. SetOption is no different than any other function, like the readvalue. Functions usually return some value, and by using something generic like $RC (ReturnCode) you are silencing the output. If you removed $RegRead from in front of the readvalue... it would also display to the screen.



Edited by Allen (2012-03-21 03:59 AM)

Top
#204535 - 2012-03-21 04:01 AM Re: SetOption("WOW64AlternateRegView", "ON") [Re: Allen]
KIXKicks Offline
Starting to like KiXtart

Registered: 2002-07-26
Posts: 177
Loc: Vancouver, WA
Thanks, everyone for the info and help!
Top
#204539 - 2012-03-21 12:02 PM Re: SetOption("WOW64AlternateRegView", "ON") [Re: KIXKicks]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
One key thing to understand about SetOption is that it returns the current setting. This allows you to modify and then return the original setting, as in
 Code:
$CurNVIS = SetOption('NoVarsInStrings', 'Off')  ; get current value and turn setting off
; code with Vars embedded in strings goes here...
$Rc = SetOption('NoVarsInStrings', $CurrNVIS)  ; restore original setting
Most of the time you turn these on at the start of your code and don't bother with them again, but there are odd conditions where you need to change the settings for a while and then set them back.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (mole) and 494 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.06 seconds in which 0.029 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org