Solved

INI location question

Posted on 2004-04-28
5
202 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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

734 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