Search:  

 
 
   All ForumsHot TopicsGallery






how-to block ads


 
Forums » Tech and Talk » OS and Software » Webmasters and Developers » %PROGRAMFILES% Environmental Variable
Search Topic:
Uniqs:
611
Share Topic:
RSS topic:
toggle:
flat / full
normal / watch
Posting:
Post a:
Post a:
javascript homework »
« Request for Site check  
AuthorAll Replies


merrix
Software Architect
Premium
join:2002-09-25
Los Angeles, CA

 %PROGRAMFILES% Environmental Variable

Is there an environmental variable that points to C:\Program Files on Win32 and C:\Program Files (x86) on Win64?

When i echo $env:PROGRAMFILES from powershell on Win64 I get C:\Program Files instead of C:\Program Files (x86)

Thanks in advanced


TheRul
You couldn't think of something?
Premium
join:2007-09-18
Victorville, CA
·Verizon FIOS


1 edit
What I have found is %programfiles(x86)% but I can not try that, as I do not have a 64 bit system available.

When was the last time you stabbed someone? »[signup] Diplomacy - Stab Me, Stab you


GILXA1226
Premium,MVM
join:2000-12-29
London, OH
clubs:

said by TheRul See Profile :

What I have found is %programfiles(x86)% but I can not try that, as I do not have a 64 bit system available.

When was the last time you stabbed someone? »[signup] Diplomacy - Stab Me, Stab you
I can confirm that this works, at least on a windows 7 64-bit install.
--
We don't give a d@mn for the whole state of Michigan... we're from OHIO! O!H! ... I!O!


merrix
Software Architect
Premium
join:2002-09-25
Los Angeles, CA

said by GILXA1226 See Profile :

said by TheRul See Profile :

What I have found is %programfiles(x86)% but I can not try that, as I do not have a 64 bit system available.

When was the last time you stabbed someone? »[signup] Diplomacy - Stab Me, Stab you
I can confirm that this works, at least on a windows 7 64-bit install.
how did you confirm? cmd? powershell?

the real question i guess is does %programfiles(x86)% fall back correctly on win32?


TheRul
You couldn't think of something?
Premium
join:2007-09-18
Victorville, CA
·Verizon FIOS

What I have read is that the %programfiles% variable is automatically changed to %programfiles(x86)% when it is used by a 32 bit program. So if your program is using %programfiles% it should do just fine if you are doing everything 32 bit. But if you are trying to do this in a 64 bit prog, it is not going to matter either way, because you will not be able to use it on a 32 bit system.
--
When was the last time you stabbed someone? »[signup] Diplomacy - Stab Me, Stab you


merrix
Software Architect
Premium
join:2002-09-25
Los Angeles, CA
reply to merrix
just to be clear i am seeking a single environmental variable that when used on a 64 bit system points to C:\Program Files (x86) and when used on a 32 bit system points to C:\Program Files.

Sorry for the confusion


TheRul
You couldn't think of something?
Premium
join:2007-09-18
Victorville, CA
Then that will be %programfiles%

Graycode

join:2006-04-17
·net2phone

reply to merrix
The answer depends on what's asking for for the value. If you're using a 32-bit application like a 32-bit installer then you may not get the same value as when using a 64-bit application on the same machine.

From within a 64-bit application you may need to first query for %ProgramFiles(x86)%, and if that doesn't exist then use %ProgramFiles%. From within a 32-bit application then %ProgramFiles% alone may suffice.

If you're using a CMD (DOS Prompt runs as 64-bit on a 64-bit machine) or BAT file, then just type SET to see all environment variables.

Also there are cases where you may need to pay attention to case sensitivity. See: »support.microsoft.com/kb/950407


GILXA1226
Premium,MVM
join:2000-12-29
London, OH
clubs:

reply to merrix
said by merrix See Profile :

said by GILXA1226 See Profile :

said by TheRul See Profile :

What I have found is %programfiles(x86)% but I can not try that, as I do not have a 64 bit system available.

When was the last time you stabbed someone? »[signup] Diplomacy - Stab Me, Stab you
I can confirm that this works, at least on a windows 7 64-bit install.
how did you confirm? cmd? powershell?

the real question i guess is does %programfiles(x86)% fall back correctly on win32?
cmd, and I doubt it would fall back correctly.
--
We don't give a d@mn for the whole state of Michigan... we're from OHIO! O!H! ... I!O!


merrix
Software Architect
Premium
join:2002-09-25
Los Angeles, CA
reply to merrix
ok I think the answer is no there is no single environmental variable that will do that.
-
Forums » Tech and Talk » OS and Software » Webmasters and Developersjavascript homework »
« Request for Site check  


Wednesday, 24-Feb 11:52:18 Terms of Use | Privacy Policy | Hosting by www.nac.net - DSL,Hosting & Co-lo | feedback | contact
over 10.5 years online! © 1999-2010 dslreports.com.
page compression OFF
Most commented news this week
· [125] Comcast Exploring 250 Mbps Service
· [105] It's Hard To Provide Tech Support For Stolen Wi-Fi
· [53] Life In The Safe Harbor About To Change For ISPs
· [50] Canada Mirrors U.S. Broadband Policy, Gets Same Crap Results
· [46] Magic Jack Tries, Fails To Shut Up Boing Boing
· [40] FCC Finds Broadband Is Expensive, People Are Strange, Uneducated
· [32] Is AT&T Shutting Down Metered Billing Trials?
· [31] PC World Tests Show Drastic AT&T 3G Improvement
· [29] CNN Is Upset That 4G Service Won't Be 100 Mbps
· [22] Verizon Skype Deal 'Exclusive'
Most people now reading
· Could I get any money for this pc at all? [General Questions]
· [ Raiding] So much for a great 1st impression... [World of Warcraft]
· I've got 45 minutes to talk about security to non-techs ... [Security]
· Car Thieves Using GPS Jammers [Security]
· Ashen Verdict Rep farming guide (ICC 10) [World of Warcraft]
· [ New 80 Leveling] Would you pay for a 80 character? [World of Warcraft]
· [WIN7] Spyware in Windows Update [Microsoft Help]
· Windows 7 boot manager editing questions [Microsoft Help]
· Ebay Bidders- Feedback system. GET A CLUE! [Rants, Raves, and Praise]