473,499 Members | 1,909 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Refering to "Program Files" directory

On WinXP, the directory where all the installed programs are stored, can
go under different names, depending on the language of the OS. E.g.
"c:\Program Files" on one system might be "d:\Program" on another. How
dows one refer to the "right" path? I'm remembering something along
"$Program" but i'd like to get an confirmation.

--
Konrad Viltersten
Jun 27 '08 #1
2 1553
Well, you have environment variables: %ProgramFiles% (and on x64,
%ProgramFiles(x86)% / %ProgramW6432%) - or through code you have:

string path =
Environment.GetFolderPath(Environment.SpecialFolde r.ProgramFiles);

mARC
Jun 27 '08 #2
Well, you have environment variables: %ProgramFiles% (and on x64,
%ProgramFiles(x86)% / %ProgramW6432%) - or through code you have:

string path =
Environment.GetFolderPath(Environment.SpecialFolde r.ProgramFiles);
Exactly what i was looking for. Thanks!

Regards
Konrad Viltersten
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1282
by: Robert Oschler | last post by:
Hello, After doing indexing of a relatively large database (4 million records), I see some files that all begin with "#sql-" in my data directory. They are identical in size to the regularly...
0
888
by: Cuperman | last post by:
Does anyone know of an issue where a Configuration Exception is thrown when "Program Files" is used as part of the initialiseData value within a custom listener? eg: <system.diagnostics> <trace...
5
16759
by: Rosa | last post by:
Hi, I'm trying to clear the TIF on Windows XP programmatically with the below code. This code works fine on any folder but the TIF. For some reason the atEnd() statements always defaults to true...
1
3616
by: Chris | last post by:
I built small C# Web and Web Service applications in a training class last week. The applications worked in the class, but when I tried to run them again over the weekend, they both bombed....
1
1500
by: Sam Martin | last post by:
Hi all, Got a problem regarding auto-updating an application. We've got an app which implements the MS AppUpdater application block, however although this all works fine when logged in as an...
2
9067
by: John Saunders | last post by:
I deploy web applications in what may be an odd manner. For every web site "x", I have an "x2" web site which points to an empty directory. I can then use Copy Project in VS.NET to deploy to the...
7
2221
by: Matt Jensen | last post by:
Howdy I want to simulate with .Net what I used to do with classic ASP where you would have a series of include files with utility functions that you would include when you needed them. I read...
0
982
by: Terry Olsen | last post by:
I need to delete files from "C:\WINNT\Downloaded Program Files" I can delete them using Windows Explorer, but they do not appear in the command prompt directory listing. How can I delete these...
9
2900
by: Keith G Hicks | last post by:
I'm having a lot of trouble with "file in use" errors in my "folder watcher" project. Starting and stopping the watcher and reading my XML file work fine. Once the watcher is started, I'm reading...
0
7131
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
6894
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7388
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5470
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3099
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3091
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
297
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.