Jump to content











Photo
* * * * - 1 votes

Get %Processor_Architecture% into WinBuilder?


  • Please log in to reply
3 replies to this topic

#1 allanf

allanf

    Gold Member

  • .script developer
  • 1256 posts

Posted 14 April 2008 - 06:31 AM

Hi,

There are Winbuilder Fixed Variables for retrieving info from the current OS, like %WindowsDir%, %UserName% and %Day% for example. I thought that amongst these there was a Winbuilder Variable for the 'Windows Version' of the current OS, and maybe some others...???

Right now, I'd like one for the %Processor_Architecture% of the OS. Is there one?

If not, how to do it? I would rather not have Winbuilder search for some unique file or check the registry. Can the variable somehow pass from cmd.exe to a Winbuilder Custom Variable?

Thanks :thumbsup:

#2 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10547 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 14 April 2008 - 09:10 AM

Yes, there is a way.

Environment variables can be found at
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment

Use a command like
RegRead,HKLM,"SYSTEM\ControlSet001\Control\Session Manager\Environment","PROCESSOR_ARCHITECTURE","%Processor_Architecture%"


http://www.boot-land...ax.html#RegRead

:thumbsup:

#3 allanf

allanf

    Gold Member

  • .script developer
  • 1256 posts

Posted 14 April 2008 - 11:24 AM

Yes, there is a way.
...
:thumbsup:


Thanks Nuno,

I am reluctant to use Registry commands because I have made (and seen) mistakes in the past.

However, the advice you have given looks safe. ... :tabletalk:

I'll try it in a while. I've hit some other snags with the new Windows AIK.

BTW, this question now seems to be in the wrong forum. Perhaps, better would be 'Winbuilder Scripting Help.'

#4 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10547 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 14 April 2008 - 01:34 PM

Will move to the "developer notes" section since it deals with scripting techniques.

Would nice to gather them there so that other people can see how this can be done.

:thumbsup:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users