%programfiles% environment variable : Native Mode and WOW Mode

Discussion in 'Windows 64bit' started by santhosh.kulandaiyan, Jul 17, 2008.

  1. Hello,


    In a 64 bit windows registry, there are 2 nodes that expand the
    %programfiles% environment variable.

    hkey_local_machine\software\Microsoft\windows\currentversion
    programfilespath = %programfiles%
    programfilesdir = c:\program files

    hkey_local_machine\software\wow6432node\microsoft\windows
    \currentversion
    programfilespath = %programfiles%
    programfilesdir = c:\program files (x86)

    So when a 32 bit process reads the %programfiles% it reads it as c:
    \program files (x86)
    and when a 64 bit process reads the %programfiles% it reads it as c:
    \program files
    ---------------------------------------------

    My question is, is it possible to define another environment variable
    in the registry that will take different values based on whether the
    process that is reading the environment variable is a 32 bit or a 64
    bit process..?

    In other words, is is possible to create a new environment variable
    which will be accessed by "Registry Redirection" mehcanism when a 32
    bit process tries to read that value ?

    --------------------------------------------

    I tried creating new variables called
    XYZPath and XYZDir in both the registry nodes specified above but the
    variable doesn't get reflected at all when i use the 'set' command.

    Also i suppose creating a new environment variable in the registry
    directory :
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
    \Environment
    would not come under the context of registry redirection...

    --------------------------------------

    Thanks
    Santhosh
     
    santhosh.kulandaiyan, Jul 17, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jack B. Pollack

    Win 98 Environment variable for My Docs

    Jack B. Pollack, Apr 15, 2004, in forum: Computer Support
    Replies:
    2
    Views:
    726
    Millimeter
    Apr 16, 2004
  2. =?Utf-8?B?cmluZGk=?=

    unattended and changing programfiles dir

    =?Utf-8?B?cmluZGk=?=, Feb 14, 2006, in forum: Windows 64bit
    Replies:
    0
    Views:
    633
    =?Utf-8?B?cmluZGk=?=
    Feb 14, 2006
  3. Jerald Pratt

    ProgramFiles Path Test on x64

    Jerald Pratt, Feb 13, 2008, in forum: Windows 64bit
    Replies:
    6
    Views:
    862
    Charlie Russel - MVP
    Feb 15, 2008
  4. vinay.babu
    Replies:
    0
    Views:
    1,053
    vinay.babu
    Oct 16, 2008
  5. Replies:
    4
    Views:
    700
    Vintz
    May 2, 2007
Loading...

Share This Page