471,109 Members | 1,382 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,109 software developers and data experts.

path environment variable

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
1 2312
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.

Similar topics

1 post views Thread by jwpioneer | last post: by
10 posts views Thread by wen | last post: by
1 post views Thread by Chris B | last post: by
4 posts views Thread by | last post: by
1 post views Thread by Colmag | last post: by
3 posts views Thread by HMS Surprise | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.