468,727 Members | 1,478 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,727 developers. It's quick & easy.

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 2230
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
1 post views Thread by CARIGAR | last post: by
9 posts views Thread by bryonone | last post: by
reply views Thread by zhoujie | last post: by
xarzu
1 post views Thread by xarzu | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.