By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,811 Members | 1,623 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,811 IT Pros & Developers. It's quick & easy.

path environment variable

P: n/a
Hi

My application installs a front-end GUI, which runs code when buttons are
clicked. It also installs a command-line utility, that is a console
application.

They are both installed to the program's application directory, along with
the DLL that contains the generic code that they both call.
My question is, is there any way of modifying the environment variable
permanently with the setup project, such that the user has got the program's
directory in their path, so that when they start a command prompt and type
the name of the application it will start? In a similar way to which
sdkvars.bat does, but permanently.
I know they will want to do this.

Thanks
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Bonj,

Yes, you can do this. You will want to modify the values in the
following registry key:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Contro l\Session
Manager\Environment

Once you do that, make sure you broadcast a WM_SETTINGCHANGE message, so
that other programs know that an environment variable has changed. If you
want to add the environment variable for the current user, then modify the
following registry key:

HKEY_CURRENT_USER\Environment

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Bonj" <Bo**@discussions.microsoft.com> wrote in message
news:1B**********************************@microsof t.com...
Hi

My application installs a front-end GUI, which runs code when buttons are
clicked. It also installs a command-line utility, that is a console
application.

They are both installed to the program's application directory, along with
the DLL that contains the generic code that they both call.
My question is, is there any way of modifying the environment variable
permanently with the setup project, such that the user has got the
program's
directory in their path, so that when they start a command prompt and type
the name of the application it will start? In a similar way to which
sdkvars.bat does, but permanently.
I know they will want to do this.

Thanks

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.