Click here to Skip to main content
15,917,709 members
Home / Discussions / C#
   

C#

 
AnswerRe: Split Word document Pin
Paul Conrad12-Oct-07 13:35
professionalPaul Conrad12-Oct-07 13:35 
QuestionHow to set an environmet variable in C# ? Pin
s v joshi10-Oct-07 21:18
s v joshi10-Oct-07 21:18 
AnswerRe: How to set an environmet variable in C# ? Pin
Lutosław10-Oct-07 21:59
Lutosław10-Oct-07 21:59 
GeneralRe: How to set an environmet variable in C# ? Pin
s v joshi10-Oct-07 23:55
s v joshi10-Oct-07 23:55 
GeneralRe: How to set an environmet variable in C# ? Pin
Scott Dorman11-Oct-07 4:13
professionalScott Dorman11-Oct-07 4:13 
GeneralRe: How to set an environmet variable in C# ? Pin
s v joshi12-Oct-07 2:45
s v joshi12-Oct-07 2:45 
GeneralRe: How to set an environmet variable in C# ? Pin
Scott Dorman12-Oct-07 2:52
professionalScott Dorman12-Oct-07 2:52 
GeneralRe: How to set an environmet variable in C# ? Pin
Dave Kreskowiak11-Oct-07 4:23
mveDave Kreskowiak11-Oct-07 4:23 
Because setting an environment variable only affects THAT PROCESS. It will NOT update the system-wide table of environment variables.

When any process is launched, that process gets a COPY of the environment variables table that launched the process.

So, Windows Explorer (the Shell) has the master copy of the running environment variables. When you double-click an application to launch it, the loader gives the new process a copy of Explorer's environment table. When the code in that process modifies the environment variables, it's modifying it's own copy of them, NOT THE MASTER COPY IN EXPLORER!!

When the new process is closed, all changes to that copy of the environment table are lost.


The master copy of the environment variables are stored in the registry under
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

But, changing those values will not take effect in any already running process. Only new processes launched by the Shell will get the updated variables.


A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


GeneralRe: How to set an environmet variable in C# ? Pin
s v joshi12-Oct-07 3:25
s v joshi12-Oct-07 3:25 
QuestionAlright, I need help with GetJSObject() Pin
shea85110-Oct-07 21:11
shea85110-Oct-07 21:11 
AnswerRe: Alright, I need help with "GetJSObject()"; Pin
Anthony Mushrow10-Oct-07 21:24
professionalAnthony Mushrow10-Oct-07 21:24 
AnswerRe: Alright, I need help with GetJSObject() Pin
wizardzz10-Apr-12 9:24
wizardzz10-Apr-12 9:24 
QuestionQuestion about active directory Pin
Robert Wang198310-Oct-07 21:10
Robert Wang198310-Oct-07 21:10 
QuestionThe value DataGridViewRow.Tag is lost after sorting Pin
Michael Sync10-Oct-07 21:01
Michael Sync10-Oct-07 21:01 
AnswerRe: The value DataGridViewRow.Tag is lost after sorting Pin
TJoe11-Oct-07 3:07
TJoe11-Oct-07 3:07 
QuestionToolStripMenuItem with ContextMenuStrip Pin
User 269896710-Oct-07 21:00
User 269896710-Oct-07 21:00 
AnswerRe: ToolStripMenuItem with ContextMenuStrip Pin
half-life10-Oct-07 21:21
half-life10-Oct-07 21:21 
GeneralRe: ToolStripMenuItem with ContextMenuStrip Pin
User 269896710-Oct-07 21:49
User 269896710-Oct-07 21:49 
GeneralRe: ToolStripMenuItem with ContextMenuStrip Pin
half-life10-Oct-07 21:53
half-life10-Oct-07 21:53 
GeneralRe: ToolStripMenuItem with ContextMenuStrip Pin
User 269896710-Oct-07 22:01
User 269896710-Oct-07 22:01 
GeneralRe: ToolStripMenuItem with ContextMenuStrip Pin
half-life10-Oct-07 22:07
half-life10-Oct-07 22:07 
QuestionThreads Pin
half-life10-Oct-07 20:56
half-life10-Oct-07 20:56 
AnswerRe: Threads Pin
Anthony Mushrow10-Oct-07 21:17
professionalAnthony Mushrow10-Oct-07 21:17 
GeneralRe: Threads Pin
half-life10-Oct-07 21:23
half-life10-Oct-07 21:23 
QuestionRegarding DIV Pin
Satish_S10-Oct-07 20:48
Satish_S10-Oct-07 20:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.