Two consecutive regset wont execute the other

(imported topic written by Braian)

Hi All,

I have this problem when running two regset in one action it will only execute on result. please check my action script for details. thanks.

Braian

action script:

if {(size of ram/1024/1024) > 1024}

regset “[HKEY_LOCAL_MACHINE\SOFTWARE\BigFix]” “LastRAMSize”="{((if (it > 128) then (((it/32)32) + (if (it mod 32 > 16) then 32 else 0) ) else it ) of (size of ram / (10241024)) as floating point /1024) as integer}"

else

regset “[HKEY_LOCAL_MACHINE\SOFTWARE\BigFix]” “LastRAMSize”="{(if (it > 128) then (((it/32)32) + (if (it mod 32 > 16) then 32 else 0) ) else it ) of (size of ram / (10241024)) as integer}"

regset “[HKEY_LOCAL_MACHINE\SOFTWARE\BigFix]” “time”="{now}"

(imported comment written by martinc)

Just to make sure, do you have the “endif” at the end as I do not see it here?

(imported comment written by Braian)

HI martinc,

same result,

action script:

if {(size of ram/1024/1024) > 1024}

regset “[HKEY_LOCAL_MACHINE\SOFTWARE\BigFix]” “LastRAMSize”="{((if (it > 128) then (((it/32)32) + (if (it mod 32 > 16) then 32 else 0) ) else it ) of (size of ram / (10241024)) as floating point /1024) as integer}"

else

regset “[HKEY_LOCAL_MACHINE\SOFTWARE\BigFix]” “LastRAMSize”="{(if (it > 128) then (((it/32)32) + (if (it mod 32 > 16) then 32 else 0) ) else it ) of (size of ram / (10241024)) as integer}"

endif

regset “[HKEY_LOCAL_MACHINE\SOFTWARE\BigFix]” “time”="{now}"

(imported comment written by liuhoting)

Hey Braian-

Does the actionscript only execute the regset for “time” right now?

(imported comment written by Braian)

Hi
liuhoting,

thanks for the reply, yes it will record the current ram (GB or MB
) and time.

(imported comment written by Braian)

liuhoting, here is the actionscript:

if {(size of ram/1024/1024) > 1024}

regset “[HKEY_LOCAL_MACHINE\SOFTWARE\BigFix]” “LastRAMSize”="{((if (it > 128) then (((it/32)32) + (if (it mod 32 > 16) then 32 else 0) ) else it ) of (size of ram / (10241024)) as floating point /1024) as integer}"

regset “[HKEY_LOCAL_MACHINE\SOFTWARE\BigFix]” “time”="{now}"

else

regset “[HKEY_LOCAL_MACHINE\SOFTWARE\BigFix]” “LastRAMSize”="{(if (it > 128) then (((it/32)32) + (if (it mod 32 > 16) then 32 else 0) ) else it ) of (size of ram / (10241024)) as integer}"

regset “[HKEY_LOCAL_MACHINE\SOFTWARE\BigFix]” “time”="{now}"

(imported comment written by martinc)

Hi Braian,

When I try the actionscript as you have it at first, I only get the time set when the ram is less than 1GB. If I add the endif before the last regset, I get the LastRAMSize and time set.

Here is what worked for me:

if {(size of ram/1024/1024) > 1024}

regset “[HKEY_LOCAL_MACHINE\SOFTWARE\BigFix]” “LastRAMSize”="{((if (it > 128) then (((it/32)32) + (if (it mod 32 > 16) then 32 else 0) ) else it ) of (size of ram / (10241024)) as floating point /1024) as integer}"

else

regset “[HKEY_LOCAL_MACHINE\SOFTWARE\BigFix]” “LastRAMSize”="{(if (it > 128) then (((it/32)32) + (if (it mod 32 > 16) then 32 else 0) ) else it ) of (size of ram / (10241024)) as integer}"

endif

regset “[HKEY_LOCAL_MACHINE\SOFTWARE\BigFix]” “time”="{now}"

When I run that through the QnA and change the “>” to “<”, I will see the time being set either way, where before without the endif, I would only see it if the RAM is < 1GB

Martin