Topic
  • 6 replies
  • Latest Post - ‏2013-10-09T13:57:41Z by martinc
Braian
Braian
61 Posts

Pinned topic two consecutive regset wont execute the other

‏2013-10-08T01:56:11Z |

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 / (1024*1024)) 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 / (1024*1024)) as integer}"

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

  • martinc
    martinc
    47 Posts

    Re: two consecutive regset wont execute the other

    ‏2013-10-08T02:59:23Z  

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

  • Braian
    Braian
    61 Posts

    Re: two consecutive regset wont execute the other

    ‏2013-10-08T05:28:22Z  
    • martinc
    • ‏2013-10-08T02:59:23Z

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

    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 / (1024*1024)) 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 / (1024*1024)) as integer}"

    endif

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

  • liuhoting
    liuhoting
    32 Posts

    Re: two consecutive regset wont execute the other

    ‏2013-10-08T07:03:32Z  
    • Braian
    • ‏2013-10-08T05:28:22Z

    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 / (1024*1024)) 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 / (1024*1024)) as integer}"

    endif

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

    Hey Braian-

    Does the actionscript only execute the regset for "time" right now?

  • Braian
    Braian
    61 Posts

    Re: two consecutive regset wont execute the other

    ‏2013-10-09T02:09:42Z  
    • liuhoting
    • ‏2013-10-08T07:03:32Z

    Hey Braian-

    Does the actionscript only execute the regset for "time" right now?

    Hi liuhoting,

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

  • Braian
    Braian
    61 Posts

    Re: two consecutive regset wont execute the other

    ‏2013-10-09T02:20:09Z  
    • liuhoting
    • ‏2013-10-08T07:03:32Z

    Hey Braian-

    Does the actionscript only execute the regset for "time" right now?

    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 / (1024*1024)) 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 / (1024*1024)) as integer}"

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

     

  • martinc
    martinc
    47 Posts

    Re: two consecutive regset wont execute the other

    ‏2013-10-09T13:57:41Z  
    • Braian
    • ‏2013-10-09T02:20:09Z

    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 / (1024*1024)) 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 / (1024*1024)) as integer}"

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

     

    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 / (1024*1024)) 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 / (1024*1024)) 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