Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

API for Windows Environment

Posted on 1998-11-19
4
Medium Priority
?
228 Views
Last Modified: 2010-04-01
is there an API for modifying windows environment variables
(e.g. classpath)
0
Comment
Question by:mickeydog
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 200 total points
ID: 1178257
Yes, the name is 'SetEnvironmentVariable()'. The only problem is that it's only valid for the current process (and processes that are created by the current one). If you want them to persist, you'll have to add them to the user's environment (different for NT & Win9x)
0
 

Author Comment

by:mickeydog
ID: 1178258
in particular, i will need to set CLASSPATH.
i wanted to set it when installing my software.
so it would seem that i would want them to persist.
this would be in windows NT.

do you know how this is accomplished?

0
 
LVL 86

Expert Comment

by:jkr
ID: 1178259
Yes (NT is easier than 9x ;-). Simply add a value to 'HKEY_CURRENT_USER\Environment' supplying the variable's name as the value name. If you want to set the value for all users, you should add this value to 'HKEY_USERS\<some SID to be replaced>\Environment'
0
 

Author Comment

by:mickeydog
ID: 1178260
ok, thanks!

0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

715 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