Page 1 of 1 1
Topic Options
#186434 - 2008-03-22 03:58 PM Need to delete or remove environment variables
BPalm Offline
Just in Town

Registered: 2008-03-22
Posts: 1
We are currently using KiXtart to set local envrionment variables within Windows XP. I would like to remove some of those set variables without having to manually go into 200 machines.

Can KiXtart remove what it has set?

Top
#186435 - 2008-03-22 04:17 PM Re: Need to delete or remove environment variables [Re: BPalm]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Yes it can.

This
 Code:
Set "Test=TestEnvVar"

will set the environment variable Test to TestEnvVar.

This
 Code:
Set "Test="

will remove the test environment variable.

Please note that you may need to start a new instance of an app if it was running while you did the change.
For example cmd.exe will not show the changes if it was running when you did the change. If you restart cmd.exe all changes are visible. The SET command will set the environment variables for the current user. The SETM command will do just the same as the SET command does but for the local system. SETM requires admin privileges for the user running the script.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#186464 - 2008-03-25 11:13 AM Re: Need to delete or remove environment variables [Re: Mart]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Or SETM to set environment variables in the environment of the local computer.
Top
#186465 - 2008-03-25 11:15 AM Re: Need to delete or remove environment variables [Re: Witto]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
 Originally Posted By: Witto
Or SETM to set environment variables in the environment of the local computer.


Wake up Witto ;\)
 Quote:

The SETM command will do just the same as the SET command does but for the local system.
....
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#186466 - 2008-03-25 12:11 PM Re: Need to delete or remove environment variables [Re: Mart]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4403
Loc: New Jersey
First off, there are two types of environment variable - System and User. When both are set, User overrides System.

System vars are defined in the HKLM hive, while User vars are in the HKCU. Once environment vars are defined, you can't tell whether they are System or User unless you consult the registry, or have personal knowledge of how they were defined.

If you use Set "X=", you will unset the User var - any system var might still be defined! Again, setting these do not affect the current Kix environment, so Kix can't tell if it's changed unless you Shell another Kix script.

Bottom line, if you set it with the Kix Set command, you need to use Set to remove it, and SetM to remove entries defined with SetM. If you don't know how it was defined, and want it completely removed, you'll need to define both System and User vars with empty values using Set and SetM.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2870 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.214 seconds in which 0.144 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org