Expanding environment variables in Windows 7 and missing properties under right click Computer -> manage
-
Wednesday, January 19, 2011 11:30 PM
Expanding environment variables in Windows 7 and missing properties under right click Computer -> manage
This issue is documented for XP and has solution to issue:
http://support.microsoft.com/kb/329308
This issues still exist in windows 7 if right click Computer - > properties is used to access and create environment variables.
This works in XP:
1) Right-click My Computer, and then click Manage.
2) In the left pane, right-click Computer Management (Local), and then click Properties.
However the properties option no longer exist in vista or windows 7. Anyone know a solution to this issue for Vista and Windows 7.
For example: if set TEST to %appdata% using Computer - > properties and you use a cmd prompt,
You will get this c:\echo %TEST%
Returns %appdata% instead of expanding it as shown in http://support.microsoft.com/kb/329308
Thanks for your help
Mike
All Replies
-
Friday, January 21, 2011 5:13 PM
If I understand the question, you are looking for the Environment Variables in WinVista/7? In Win7, Right Click on Computer, then click Advanced System Properties on the left, the Advanced.- Proposed As Answer by Andre.ZieglerMicrosoft Community Contributor Saturday, January 22, 2011 1:32 PM
-
Saturday, January 22, 2011 7:29 AMModerator
I guess if you really are looking for bringing up that properties to modify environment variable, there are multiple ways to do that. One of them is as Jamie suggested.
You can also run sysdm.cpl and go to advanced > environment
also, you can leverage powershell to do so or you can use system.environment class.
Please let us know if that is the only thing you were looking for.
KetanT | Microsoft- Proposed As Answer by Andre.ZieglerMicrosoft Community Contributor Saturday, January 22, 2011 1:33 PM
-
Tuesday, January 25, 2011 5:34 PMThanks for the replies, It is the same issue as documented by Microsoft here: http://support.microsoft.com/kb/329308 If you add %APPDATA% to any user or system environment variable by using the following method, %APPDATA% may not be resolved to the appropriate user application data folder: Right-click My Computer, and then click Properties. On the Advanced tab, click Environment Variables. Add a new user or system environment variable named PATH. Set the Variable value entry to %APPDATA%. Apply the settings. If you then start a command session (Cmd.exe) and check the PATH environment variable by using the set path command, %APPDATA% may not be expanded to the appropriate user application folder. Instead, you see "%APPDATA%."” THIS bug is still in Windows 7. However the solution provided by MS (using manage) no longer exists for windows 7 or vista. Is there a way to perform the solution in windows 7? Thanks
- Edited by Gumby65 Tuesday, January 25, 2011 5:43 PM Formating issues
-
Tuesday, January 25, 2011 5:47 PM
Not exactly. In XP, depending on how the var is added, it might or might not expand if you use a windows standard variable in the set part of the variable. I need the same workaround MS supplied XP for Windows 7. ThanksI guess if you really are looking for bringing up that properties to modify environment variable, there are multiple ways to do that. One of them is as Jamie suggested.
You can also run sysdm.cpl and go to advanced > environment
also, you can leverage powershell to do so or you can use system.environment class.
Please let us know if that is the only thing you were looking for.
KetanT | Microsoft -
Tuesday, February 01, 2011 3:00 PMHi KetanT, Do you know any other resources I can check? I find it interesting that MS removed the workaround without fixing the issue. They state the issue is caused by a problem in Shell32.dll Thanks
-
Saturday, February 05, 2011 7:21 AMModerator
Hi Gumby,
I tried on my Win7 (ultimate) :
1. Run > sysdm.cpl > Advanced > Environment Variable > Edit 'Path' system variable to append %appdata%
2. I start a new cmd and type 'set path' and I see 'C:\Users\<Username>\AppData\Roaming'
Is that not the behavior you are experiencing?
Is that something you are not expecting?
Does it change the behavior on UAC or non-UAC environment?
Considering we modified 'path' system variable, which is part of 'windows standard variable', does it not apply to all the users? (i.e. log off and login with a different non-admin user)
KetanT | Microsoft -
Tuesday, February 08, 2011 9:50 PM
Hi Gumby,
I tried on my Win7 (ultimate) :
1. Run > sysdm.cpl > Advanced > Environment Variable > Edit 'Path' system variable to append %appdata%
2. I start a new cmd and type 'set path' and I see 'C:\Users\<Username>\AppData\Roaming'
Is that not the behavior you are experiencing?
Is that something you are not expecting?
Does it change the behavior on UAC or non-UAC environment?
Considering we modified 'path' system variable, which is part of 'windows standard variable', does it not apply to all the users? (i.e. log off and login with a different non-admin user)
KetanT | MicrosoftHi Ketan,
I tried your exact directions for appending %appdata% to the end of path and I see the following:
Open a new command line and type
Echo %path%
Or Set Path
I get the following echoed back: “…;…;…;%appdata%”
%appdata% is echoed back and not expanded. Same results when setting TEST to %appdata%
There is no difference if admin or user. Same results.
OS version is Windows 7 6.1.7600 (Build 7600)
Do you have the same OS version?
Thanks
-
Wednesday, February 09, 2011 8:03 AMModerator
Hi,
We are getting somewhere here, I have the same build bumber. Here is how I could reproduce the difference in behavior:
1. Run cmd with elevated privilages > type sysdm.cpl > advanced > environment variables > edit Path system variable to append %appdata%
2. Close this cmd window.
3. Now, if you run cmd again with elevated privilages, and type 'path', you see it expanded like: c:\users\<username>\AppData\roaming
4. Close that window and open the cmd window again without admin privilages. Type 'path' and you will see %appdata% appended.
Can you confirm this behavior?
KetanT | Microsoft -
Wednesday, February 09, 2011 3:16 PM
See bold text above for my responses.Hi,
We are getting somewhere here, I have the same build bumber. Here is how I could reproduce the difference in behavior:
1. Run cmd with elevated privilages > type sysdm.cpl > advanced > environment variables > edit Path system variable to append %appdata%
- Done
2. Close this cmd window.
- Done
3. Now, if you run cmd again with elevated privilages, and type 'path', you see it expanded like: c:\users\<username>\AppData\roaming
- No, I get %appdata%. It does not expand
4. Close that window and open the cmd window again without admin privilages. Type 'path' and you will see %appdata% appended.
- Done, and I get %appdata% appended. It does not expand.
Can you confirm this behavior?
-
When adding the variable, logged in as a different user with administrator privileges, however not 100% control as only a few folks in the organization are approved for those (mostly network related not allowed). Logged off and logged in as a different user. See no difference at all in results.
-
So are you able to duplicate part of the issue? It is interesting that MS stated the behavior was sporadic however it has been constant for me on all XP machines.
-
MS stated before the issue is caused by a problem in Shell32.dll in XP and it appears they did not resolve it. Do you have access to ask MS were they moved the workaround?
Thanks
KetanT | Microsoft -
Wednesday, February 09, 2011 3:20 PMModerator
Hi,
The behavior is not consistent, no doubt about that.
The process is already started. I'll get back to you with some update as soon as I have.
Thanks for posting this.
KetanT | Microsoft -
Friday, February 18, 2011 10:48 AMModerator
Hi,
We (Microsoft) are taking a look at it, but we can’t say when or how it will be changed as there is a lot of investigation to be done still.
Thanks.
KetanT | Microsoft -
Wednesday, February 23, 2011 9:02 PM
Hi,
We (Microsoft) are taking a look at it, but we can’t say when or how it will be changed as there is a lot of investigation to be done still.
Thanks.
KetanT | Microsoft
Thanks KetanT,
Do you have access to my email address? If so, could you please send me and email when you receive updated information on this issue?
-
Thursday, February 24, 2011 10:22 AMModerator
Hi,
Please send email to blrforum-at-microsoft.com
KetanT | Microsoft -
Thursday, April 05, 2012 4:09 PMWe've come across exactly this problem today. Was there a resolution for this (other than not putting environment variables in PATH)? The last activity was over a year ago.
- Proposed As Answer by Michael.W.Myers Sunday, November 11, 2012 8:35 PM
- Unproposed As Answer by Michael.W.Myers Sunday, November 11, 2012 8:39 PM
-
Thursday, October 25, 2012 8:53 PMwe too have the exact same problem and need an answer or workaround.
-
Sunday, November 11, 2012 8:44 PM
For Win 7
1. goto Control Panel\User Accounts and Family Safety\User Accounts
2. left pane select Change my environment variables.
3. select edit for the var you wish to change.
thats it, hope this helps
Michael
- Proposed As Answer by Michael.W.Myers Sunday, November 11, 2012 8:44 PM
-
Sunday, January 27, 2013 1:13 AMI had a similar problem with Server 2008 -- after installing a couple programs the system path variable wouldn't expand %xxx% values. Tried through user accounts instead of via My Computer -> Advanced Settings and it worked!

