CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2009
    Posts
    1

    Question x64 environment variables

    Hello!

    I have some problems with Win7 x64 environment variables.

    Question 1:
    Why %PROGRAMFILES% and %PROGRAMFILES(X86)% both lead to x:\Program Files (x86) - not to x:\Program Files and x:\Program Files (x86) ?

    I am unable to run some shortcuts ( e.g. "x:\ProgramData\Microsoft\Windows\Start Menu\Programs\Games\Solitaire.lnk" ) from win32 app, because the shortcut link points to x:\Program Files (x86)\... , but this games is actually in x:\Program Files\...

    Question 2:
    How do I know where the app is found in fact?

    Question 3:
    How do I run such shortcuts and get icons from them from win32 app?

    Thanks in advance.

  2. #2
    Join Date
    Feb 2009
    Location
    India
    Posts
    444

    Re: x64 environment variables

    %PROGRAMFILES% and %PROGRAMFILES(X86)% are different only for 64-bit applications.
    The application you are using is probably 32-bit.
    «_Superman
    I love work. It gives me something to do between weekends.

    Microsoft MVP (Visual C++)

  3. #3
    Join Date
    Feb 2002
    Posts
    4,640

    Re: x64 environment variables

    My guess is for backward compatibility with 32 bit apps. Look for %ProgramW6432% instead.

    Viggy

  4. #4
    Join Date
    Oct 2008
    Posts
    68

    Re: x64 environment variables

    You can go and get the environment variable for %systemdrive% and then you can go and manual move the directory to Program Files or Program Files (x86).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured