|
| ||||||||||
| Tags: command, environment, variable |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Remove system environment variable using command line ?
How do I remove system environment variable using command line ? For example I can add it using: setx y 10 -m But from setx documentation: "You cannot use setx to remove values added to the local or system environments." (I know how to remove using GUI but this is not the case) thanks Vilius |
|
#2
| |||
| |||
| Re: Remove system environment variable using command line ? "Vilius Mockûnas" <v_mockunas@yahoo.com> wrote in message news:uOmTtc06JHA.5828@TK2MSFTNGP04.phx.gbl... > Hello, > > How do I remove system environment variable using command line ? > For example I can add it using: > setx y 10 -m > But from setx documentation: > "You cannot use setx to remove values added to the local or system > environments." > > (I know how to remove using GUI but this is not the case) > > thanks > Vilius The following script will first set, then remove the system variable %XVar%: Set wshShell = CreateObject("WScript.Shell") Set wshSEnv = wshShell.Environment("System") sMyVar = "XVar" wshSEnv(sMyVar) = "Vilius" WScript.Echo "Variable " & sMyVar & " is now set to Vilius" wshSEnv.Remove sMyVar |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Remove system environment variable using command line ?" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to Enable system protection from command line | Abhaa | Operating Systems | 4 | 30-01-2011 05:47 PM |
| Importance of Command Line User Environment in Linux | aFRODITA | Operating Systems | 4 | 12-11-2010 06:31 AM |
| Is " CLUE" Command Line User Environment important aspect of linux | Loyalpalm | Operating Systems | 5 | 11-11-2010 10:10 AM |
| How to change/add environment variables from command line PERMANENTLY? | Moiz | Windows XP Support | 2 | 01-04-2009 05:46 PM |
| system restore from command line | merrittr | Windows XP Support | 7 | 27-08-2008 12:45 AM |