Solved

INI location question

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

809 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