473,624 Members | 2,584 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 1565
Well, you have environment variables: %ProgramFiles% (and on x64,
%ProgramFiles(x 86)% / %ProgramW6432%) - or through code you have:

string path =
Environment.Get FolderPath(Envi ronment.Special Folder.ProgramF iles);

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

string path =
Environment.Get FolderPath(Envi ronment.Special Folder.ProgramF iles);
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
1296
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 named data files in that directory. Are they some backup or temporary files that were left behind? Is it safe to delete them? Thanks.
0
896
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 autoflush="false" indentsize="4"> <listeners> <add name="myListener" type="System.Diagnostics.TextW­riterTraceListener" initialiseData="C:\Program Files\log.log"/>
5
16768
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 and no files are deleted in the folder. The peculiarity of this issue is that the files/subfolders cannot be seen through the windows explorer either. I can only access/delete them through a command shell. Any ideas?
1
3631
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. Instead of getting my Web page, or the Web Service page, I get a page full of error text (below). I am hoping the anwser will be obvious to someone. I've tried a few things to address the problem, including
1
1510
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 administrator - when running the app and trying to update with a latter version from a web server (note: the app is installed under the "Program Files" folder) - an exception is thrown as the normal user doesn't have permission to modify / create...
2
9088
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 empty directory, and have the x2 site QA'd. I then switch over by creating a new empty directory for the next time, and in IIS, pointing the x2 site to the new directory and finally pointing the "x" site to the newly-deployed directory. This...
7
2230
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 some article about creating a utility class, but it gave no details, and I'm not sure what to do. Do I create a .cs file and then just include it? What should the class inherit from? And how do you inherit more than one class on your page in...
0
992
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 items using VB? *** Sent via Developersdex http://www.developersdex.com ***
9
2909
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 the text files from the watched folder line by line into variables and then posting them to a SQL table. All of the code for the form is shown below. And it works fine except for 2 issues. First issue: In the Finally of the Try for teh SQL...
0
8685
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8633
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7176
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6112
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4084
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4187
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1797
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1493
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.