Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

INI location question

Posted on 2004-04-28
5
Medium Priority
?
204 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 70

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 500 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

704 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