mikeappleb Posted November 3, 2006 Report Share Posted November 3, 2006 I have a environment setting that will not get placed into the ME variable. The defaults from the drop down work and I can get a few others but but I want the settings I've set too. At a cmd prompt I set myTemp=c:\mike\bitbucket then in macex Variable Set String %T20% from Environment Variable <TVAR2:20:11:mytemp> I cannot get the value of myTemp into a ME varaible. Why not? Quote Link to comment Share on other sites More sharing options...
kevin Posted November 3, 2006 Report Share Posted November 3, 2006 This is due to the way Windows works. The environment variables are not "global". When Windows starts up a program, in this case Macro Express, it gives a 'copy' of the environment variables to that program. Each program gets their own copy. This is different than the old DOS days where there was only one copy of the environment variables and they were available to every program. Because of this 'feature', using the environment variables gets a little interesting. When Macro Express was started it got a copy of the environment variables. The Command Prompt got a copy of the environment variables when it was is loaded. When you change an enviroment variable in the Command Prompt it is changed for that program (Command Prompt) but not for any other programs. When one program launches another, the copy of the environment variables from the 'parent' program is used when creating the enviroment variables for the 'child' program. So, if you make sure that Macro Express is not running, and then, from a Command Prompt, set one or more environment variables, and then, again from the Command Prompt, you launch Macro Express, then Macro Express will see the newly set variables. However, if we go one step further, and say that you then change the environment variables again in the Command Prompt, those changes will not be seen by Macro Express unless Macro Express is terminated and relaunched (from the Command Prompt). You should also know that it doesn't work to terminate and relaunch Macro Express from Windows after the environment variables have been changed in the Command Prompt. In this case Windows passes its original copy of the environment variables to Macro Express and those do not include the environment variables that were changed in the Command Prompt. If you change the environment variables in Windows and then lauch Macro Express, then Macro Express will see the changed environment variables. To change the environment variables in Windows XP click Start, Control Panel, System, Advanced, and click on the Environment Variables button. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.