Program Path with ENVIRON

ta5
Member Posts: 1,164
Hi
I have a question to ENVIRON command
If I use environ('ProgramFiles'), I get 'c:\program files (x86)' on a german Windows7 64 Bit.
Digging a bit deeper, on a command line I get 2 values: 'c\program files' AND 'c:\program files (x86)'.
This behaviour seems by desing, because in fact there exist 2 environ variables ProgramFiles and ProgramFiles(x86) beginning with the same letters.
Is there a way to return only one value, means using no "Wildcards"?
Thanks for any ideas.
Thomas
I have a question to ENVIRON command
If I use environ('ProgramFiles'), I get 'c:\program files (x86)' on a german Windows7 64 Bit.
Digging a bit deeper, on a command line I get 2 values: 'c\program files' AND 'c:\program files (x86)'.
This behaviour seems by desing, because in fact there exist 2 environ variables ProgramFiles and ProgramFiles(x86) beginning with the same letters.
Is there a way to return only one value, means using no "Wildcards"?
Thanks for any ideas.
Thomas
0
Answers
-
There are no wildcards involved here. Instead, the environment is differently when seen from a program running under WoW64 to when seen from a native x64 program.0
-
Do you man, if a 64 bit NAV calls the ENVIRON('ProgramFiles') function, the return value is not the same as when a 32 bit NAV would do the same?
But anyway, there are 2 different Environment variables as written in the init post.... :?0 -
Yes, exactly.
In a 32-bit cmd-shell you usually have
ProgramFiles=C:\Program Files (x86)
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
in a 64-bit cmd-shell you usually have
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
(That's for Windows 7 x64)0 -
Thanks, this is solved now! I was not Aware about different shells on the same machine!
Regards
Thomas0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 322 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions