Solved

INI location question

Posted on 2004-04-28
5
199 Views
Last Modified: 2010-04-15
I need to edit the ini file in notepad from the windows directory (or application directory)... how do I do that without hardcoding it?

System.Diagnostics.Process.Start("notepad.exe", "c:\\windows\\myini.ini");
0
Comment
Question by:sticar
5 Comments
 
LVL 22

Expert Comment

by:_TAD_
ID: 10939457


Use the

Application.StartUpPath

or something like that.


The Application object has a lot of usefull things
0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 10939500
Check under Environment. There is a property that gives you the system folder.
0
 
LVL 48

Accepted Solution

by:
Jay_Jay70 earned 125 total points
ID: 10984554
Try the following

System.Diagnostics.Process.Start( "notepad.exe", Environment.GetEnvironmentVariable("windir").ToString() + "\\myini.ini" );


JJ
0
 

Author Comment

by:sticar
ID: 11000599
Sorry... I went on vacation before trying this out.  I'll let you know tomorrow....Thanks for the input.
0
 

Author Comment

by:sticar
ID: 11014679
Perfect!  Thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now