Hey, I need to know how to add my program to the environment variable PATH without messing up my PATH in the process... Of course I plan to use Environment.GetEnvironmentVariables() and set...

Anyone have some experience with this?

Recommended Answers

All 4 Replies

Google came up with This link.

I believe it does everything you need it to =) (I suggest following its instructions by the way and doing it as a set-up process or perform some kind of detection so you don't add it repeatedly during your program execution)

commented: ty ty +8

Google came up with This link.

I believe it does everything you need it to =) (I suggest following its instructions by the way and doing it as a set-up process or perform some kind of detection so you don't add it repeatedly during your program execution)

I'm actually a little stumped about adding the path to my .exe to the PATH in the first place, that article mainly has a method to notify windows of the changes, right?

It was one of the links on that page that contained the actual code.

You will need the rest of the code (about the notification) so that windows and the various windows updates to recognise the new path information.

It was one of the links on that page that contained the actual code.

You will need the rest of the code (about the notification) so that windows and the various windows updates to recognise the new path information.

Thank you sir you are an expert lifesaver! I accidentally hit the -1 button in my hurry, sorry :/

But at least we both know you did excellently!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.