none
Environment variables missing and can't open advanced system settings

    Question

  • Hi all,

    I'm using a windows 7 32 bit system and have had this problem for several weeks. The problem started after I installed a GTK+ 2.6 file (gtk-win32-2.6.10-rc1) that messed up my environment variables (I was trying to get this calculator emulator program to work http://lpg.ticalc.org/prj_tiemu/win32.html). I have since uninstalled and deleted that file but it didn't help. Now I have many problems. First, I am unable to install any new programs. This includes updating firefox, adobe, and microsoft update, etc. Also, certain windows accessories programs such as calculator, command prompt, notepad, paint, etc don't have the normal icon anymore and don't do anything when I click on them. Also system restore and backup don't run either, when I click on the icon under the program list nothing happens.

    I also cannot access the advanced system settings after opening system properties, I get the error saying "Windows cannot find '%windir%\system32\systempropertiesadvanced.exe'. Make sure you typed the name correctly, and then try again." Also, after using the computer for a while ~1hr, on my desktop it says in the bottom right hand corner that my copy of windows might not be authentic (which is wrong since I bought the os from my school). When I go to check the windows activation settings under system properties it says "status not available" and "Product ID: Not Available".

    I think it is definitely a environment problem and when I run cmd and type echo %PATH% I just get a single semicolon with nothing else. After searching for answers I found many people with the same problem but no solutions. How do you add the default environments back in (C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;) when you can't access the edit function under advanced settings?

    In trying to find a way to do this through a command prompt I discovered that typing regedit only runs when I'm in safe mode and not under normal startup. I get the error: "C:\Windows\regedit.exe  The system could not find the environment option that was entered."

    I tried to run system file checker but it always had errors. And as I mentioned earlier system restore and backup will not run since they can't find the environment. I really think a solution would be to add back in the default environment variables, but I don't know how without using the advanced settings. I would really like to find a solution to this so I won't have to reinstall windows. Right now, the computer runs fine, but at some point I'm going to want to install a new program or at least update my current ones (esp windows).

    Thanks for the help.






    Tuesday, March 22, 2011 2:30 AM

All replies

  • Update --

    I was able to enter the default environments back in to the system variable path while running under safe mode. However this only solved a few of my problems. While in safe mode I was able to update firefox, thunderbird, and adobe, but I still can't install new programs or update windows and I still have the same errors when trying to access windows applications (such as calculator) and advanced system properties. Now when I type echo %path% I get the default environments, but I still have the same errors about being unable to run things.


    • Proposed as answer by hema siwakoti Wednesday, November 28, 2012 5:19 PM
    Tuesday, March 22, 2011 5:42 PM
  • Hi, please try to perform an in-place upgrade:

    http://support.microsoft.com/kb/2255099

     

    Seven

    Thursday, March 24, 2011 3:27 AM
  • So I was looking for a more elegant solution, but I guess a repair install is my only option.

    Unfortunately when I put in the installation dvd and clicked on setup.exe, I was greeted with the following:

    "D:\setup.exe

    The system could not find the environment option that was entered."

    Foiled again. What is strange is that I can browse through all the files and folders of the installation disc, but whenever I try to run an executable it doesn't work. Also, if I load in safe mode, the installation runs fine. However, you can't do a in-place upgrade from safe mode so again I'm stuck.

    Sunday, March 27, 2011 8:03 PM
  • I made a bootable usb key with the installation and also tried mounting an iso of the win7 installation dvd. Same results when I tried to run setup.exe, "The system could not find the environment option that was entered."

    Anyone know what is going on?
    Sunday, March 27, 2011 9:30 PM
  • In case it is helpful, I tried running sfc several more times from a command prompt at boot through the win7 dvd. I kept getting the same result, "Windows Resource Protection found corrupt files but was unable to fix some of them. Details are included in the CBS.Log." I'm not really sure what the log file says, but it always stopped almost immediately after finishing the verify portion of the program. It seems to have a problem with a file called encdec.dll. Here's what it says at the end of the file when it begins the repair part:

    CSI   00000668  [SR]  Repairing 1 components

    CSI   00000669  [SR]  Beginning Verify and Repair transaction

    CSI   0000066a  Hashes for file member \SystemRoot\WinSxS\x86_microsoft-windows-tvencdec_31bf3856ad364e35_6.1.7600.16385_none_e04e6c93efba3643\EncDec.dll do not match actual file [l:20{10}]"EncDec.dll" :  Found: {l:32 b:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=} Expected: {l:32 b:SBvRwpCATs3ooB52rDP3Lg1RjkSzJL9/yb61m7wtDvc=}

    CSI    0000066b [SR] Cannot repair member file [l:20{10}]"EncDec.dll" of Microsoft-Windows-TVEncDec, Version = 6.1.7600.16385, pA = PROCESSOR_ARCHITECTURE_INTEL (0), Culture neutral, VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, hash mismatch

    CSI    0000066c Hashes for file member \SystemRoot\WinSxS\x86_microsoft-windows-tvencdec_31bf3856ad364e35_6.1.7600.16385_none_e04e6c93efba3643\EncDec.dll do not match actual file [l:20{10}]"EncDec.dll" :
      Found: {l:32 b:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=} Expected: {l:32 b:SBvRwpCATs3ooB52rDP3Lg1RjkSzJL9/yb61m7wtDvc=}

    0000066d [SR] Cannot repair member file [l:20{10}]"EncDec.dll" of Microsoft-Windows-TVEncDec, Version = 6.1.7600.16385, pA = PROCESSOR_ARCHITECTURE_INTEL (0), Culture neutral, VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, hash mismatch

    CSI    0000066e [SR] This component was referenced by [l:238{119}]"Microsoft-Windows-Client-Features-Package~31bf3856ad364e35~x86~~6.1.7600.16385.Microsoft-Windows-Client-Features-Update"

    CSI    0000066f Hashes for file member \SystemRoot\WinSxS\x86_microsoft-windows-tvencdec_31bf3856ad364e35_6.1.7600.16385_none_e04e6c93efba3643\EncDec.dll do not match actual file [l:20{10}]"EncDec.dll" :
      Found: {l:32 b:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=} Expected: {l:32 b:SBvRwpCATs3ooB52rDP3Lg1RjkSzJL9/yb61m7wtDvc=}

    CSI    00000670 [SR] Could not reproject corrupted file [ml:520{260},l:46{23}]"\??\C:\Windows\System32"\[l:20{10}]"EncDec.dll"; source file in store is also corrupted

    CSI    00000671 Repair results created:

    CSI    00000672 [SR] Repair complete

     

    Not sure what all of this means. Maybe someone does. If you want the rest of the log file just let me know and I can email it or post it somewhere online.

    Thanks

    Monday, March 28, 2011 1:26 AM
  • Update --

    I was able to enter the default environments back in to the system variable path while running under safe mode. However this only solved a few of my problems. While in safe mode I was able to update firefox, thunderbird, and adobe, but I still can't install new programs or update windows and I still have the same errors when trying to access windows applications (such as calculator) and advanced system properties. Now when I type echo %path% I get the default environments, but I still have the same errors about being unable to run things.


    See if fixing the %windir% path helps.

    In the Environment Variables window, double-click "windir" and set its value data as follows:

    %SystemRoot%

     


    Ramesh Srinivasan | The Winhelponline Blog
    Microsoft MVP, Windows Desktop Experience
    Thursday, April 21, 2011 7:26 AM
    Answerer
  • um..i went to safe mode then i jus restore to an earlier point...worked for me..i had the same problem
    Thursday, May 19, 2011 10:22 AM
  • Possible new answer for this problem! Somebody else has proposed that this is related to the PATH environment variable being excessively long... I checked mine, and there was a bunch of duplicated information in it, and I'm now crossing my fingers and getting ready to reboot. We still need to reboot, I guess... I haven't had to play with environment variables since Windows NT! Would have thought that the reboot wouldn't be neccessary, but the fix isn't working, yet... will check back in and let you know how it works out!

     

    --UPDATE! Reboot not required! I can now launch SystemPropertiesAdvanced.exe and other similar system utilities without the error message about windir. I will propose this as the solution to this thread!

    • Proposed as answer by wayvirgo Thursday, August 04, 2011 9:50 PM
    Thursday, August 04, 2011 9:44 PM
  • wayvirgo, I follow your advice and now the %windir% variable works, however the icon of the explorer doesn't appear. Definitely is the lenght of the PATH environment variable.

    Thanks you and thanks all

    Friday, May 11, 2012 4:43 PM
  • Possible new answer for this problem! Somebody else has proposed that this is related to the PATH environment variable being excessively long... I checked mine, and there was a bunch of duplicated information in it, and I'm now crossing my fingers and getting ready to reboot. We still need to reboot, I guess... I haven't had to play with environment variables since Windows NT! Would have thought that the reboot wouldn't be neccessary, but the fix isn't working, yet... will check back in and let you know how it works out!

    --UPDATE! Reboot not required! I can now launch SystemPropertiesAdvanced.exe and other similar system utilities without the error message about windir. I will propose this as the solution to this thread!

    WooHoo!!!!! Excellent find.  This has been driving me CRAZY!  To fix the icons in Win7:

    In Safe Mode, navigate to {username}\appdata\local\ and delete IconCache.db and then reboot.

    • Proposed as answer by MSDNDownloads Tuesday, February 26, 2013 4:12 PM
    Friday, November 02, 2012 7:45 PM
  • I had also same problem and it was also related to the entries in the PATH variable. My problem happened after installing SQL Server 2012 Enterprise. I looked in the PATH and there were some duplicate entries and also the last entry seemed incomplete. I just removed all of the SQL Server 2012 entries and my desktop functionality has returned. I think I will install SQL Server 2012 on it's own VM so not to cause this issue again. 

    I fixed by

    1. Open command prompt (run cmd from start menu)

    2. change directory to c:\Windows\System32 and run systempropertiesadvanced.exe

    3. Locate  click on Environment Variables and located PATH in System variables

    4. Make a copy of the entry here and then inspect and remove any duplicate or incomplete entries (in my case I just ranked all of the SQL Server 2012 related entries)

    Save and you should be back up and running.

    Tuesday, February 26, 2013 4:18 PM
  • This worked for me (running SystemPropertiesAdvanced.exe from command prompt, selecting Path under System Variables) and then just taking out the %SystemRoot% entries (I had 3 different paths which included %SystemRoot%....once this was taken out, all my problems were fixed.

    Special note, you still have to have the system variable "windir" "C:\Windows" which value is actually %SystemRoot%

    Cheers!!


    • Edited by Junior-Jr Tuesday, September 17, 2013 2:22 PM
    Tuesday, September 17, 2013 2:20 PM
  • i have never heard of someone starting to argue with someone who is trying to help and obviously know abit more on the subject in the first place or the person wouldnt need help and then to start telling the helper that they or just trying to score points etc etc is so rude i would of just stopped there and then and not reply'ed again to her question some people there the ones who think there always right and never our 
    Monday, March 24, 2014 3:37 PM
  • I changed the directory and attempted to run the systempropertiesadvanced.exe and it gave me the environment error
    Saturday, April 05, 2014 4:35 PM
  • This problem is caused by the System Path exceeding 2048 characters.

    To resolve

    1. Run c:\Windows\System32\systempropertiesadvanced.exe
    2. Click on Environment Variables and located PATH in System Variables
    3. Remove any duplicate entries
    4. If the length still exceeds 2048 characters, change some of the paths to use the short file 8.3 versions. i.e. instead of 'c:\program files\' you would use 'c:\PROGRA~1\' or 'C:\PROGRA~2\
       You can find the short path name by opening the command prompt and using 'DIR /X' to return the directory listing with the short path equivalents
    5. Click OK to save the updated PATH and all should now be OK.

    Hope this helps.


    • Proposed as answer by TheDukeUK Sunday, June 05, 2016 4:43 AM
    Wednesday, October 15, 2014 11:12 AM
  • Thanks a lot, solved my issues.

    Magnus Wernersson

    Tuesday, February 03, 2015 9:17 PM
  • "Somebody else has proposed that this is related to the PATH environment variable being excessively long"

    This is precisely the problem, but I think it's relative to other factors. I had this same problem with my work machine just now, and it took digging this up for me to actually realize it. In short, I suspect that this is an insidious memory allocation problem that arises since the already too-long path becomes more difficult to allocate memory for as the system stays up for a while and continues to gain more memory pressure from other running processes (this is obvious since the same paths were sitting in my system even when it was actually working). In retrospect, it amazes me that something as simple as this can cripple the system to this extent - I would hope that Microsoft would employ a more robust solution to implementing such variables in the first place.





    • Edited by cdev1100 Thursday, March 26, 2015 1:31 PM
    Thursday, March 26, 2015 1:13 PM
  • Hi,   You can see ans in this thread. Just putting it in one reply     

    ----------------------------------------------------------------------

    1. Run c:\Windows\System32\systempropertiesadvanced.exe

    or PS C:\Windows\System32> .\SystemPropertiesComputerName.exe
    2. Click on Environment Variables and located PATH in System Variables
    3. Remove any duplicate entries

    Usually   the sytem variable  windir should be C:\Windows  ,  this was something different in my case.

    It works.

    ----------------------------------------------------------------------

    additionally, you can use cmd lines to set user variables.   https://technet.microsoft.com/en-us/library/cc755104.aspx#BKMK_examples

    regards,

    Dharanesh,

    Wednesday, July 22, 2015 6:07 AM
  • I had this issue, and found the root cause, immediate work-around, and long term fix:

    Root Cause: if your combined PATH environment variables are more than 2048 characters, then it (and WINDIR) stop being visible in many contexts.  This may cause start menu items/programs to be "not found", even though they are in fact there, and work if run manually from windows explorer or command prompt.

    Interim Fix (maybe): I've had mixed results with this, but if you open Task Manager (Ctrl-Alt-Del Task Manager) and quit Explorer (note desktop will go blank and start menu goes away), and then run Explorer again, all the problems temporarily disappear and things work properly.  However, this is only a temporary solution.

    FIX/Solution:  Reduce the PATH variable to be under 2048 characters in total.  Using Windows Explorer or via command prompt, run

    c:\windows\system32\systempropertiesadvanced.exe

    Click the Environment Variables button at the bottom and review the entries.  Deleting unused or not needed entries so the total is under 2048 characters in total (from the PATH variable) should fix the issue.  You can then retry the interim fox and all should be well, and once you safely reboot, the solution should stick.

    This applies to Windows 7, Vista, XP.  Not sure about 8 or 10 yet.


    • Edited by Pr0x1 Thursday, August 20, 2015 1:56 PM
    • Proposed as answer by TheDukeUK Sunday, June 05, 2016 4:47 AM
    Thursday, August 20, 2015 1:54 PM
  • I had this issue, and found the root cause, immediate work-around, and long term fix:

    Root Cause: if your combined PATH environment variables are more than 2048 characters, then it (and WINDIR) stop being visible in many contexts.  This may cause start menu items/programs to be "not found", even though they are in fact there, and work if run manually from windows explorer or command prompt.

    Interim Fix (maybe): I've had mixed results with this, but if you open Task Manager (Ctrl-Alt-Del Task Manager) and quit Explorer (note desktop will go blank and start menu goes away), and then run Explorer again, all the problems temporarily disappear and things work properly.  However, this is only a temporary solution.

    FIX/Solution:  Reduce the PATH variable to be under 2048 characters in total.  Using Windows Explorer or via command prompt, run

    c:\windows\system32\systempropertiesadvanced.exe

    Click the Environment Variables button at the bottom and review the entries.  Deleting unused or not needed entries so the total is under 2048 characters in total (from the PATH variable) should fix the issue.  You can then retry the interim fox and all should be well, and once you safely reboot, the solution should stick.

    This applies to Windows 7, Vista, XP.  Not sure about 8 or 10 yet.

    • Proposed as answer by TheDukeUK Sunday, June 05, 2016 4:47 AM
    Thursday, August 20, 2015 1:57 PM
  • This problem is caused by the System Path exceeding 2048 characters.

    To resolve

    1. Run c:\Windows\System32\systempropertiesadvanced.exe
    2. Click on Environment Variables and located PATH in System Variables
    3. Remove any duplicate entries
    4. If the length still exceeds 2048 characters, change some of the paths to use the short file 8.3 versions. i.e. instead of 'c:\program files\' you would use 'c:\PROGRA~1\' or 'C:\PROGRA~2\
       You can find the short path name by opening the command prompt and using 'DIR /X' to return the directory listing with the short path equivalents
    5. Click OK to save the updated PATH and all should now be OK.

    Hope this helps.


    Thank you. Mine was 2069.

    Lots of Duplicates of C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64 and C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared

    Deleted all the duplicates and it's now 1,472

    I did wonder why I kept losing SystemRoot 

    Many Thanks

    Sunday, June 05, 2016 4:46 AM
  • the issue is the PATH of SystemRoot is not set correctly in OS variables so you have to check the below:

    1- go to C:\Windows\System32\SystemPropertiesComputerName.exe

    2- advanced

    3- Environment Variables

    4- User Variables

    5- add windir>>%SystemRoot%

    ----------------------------

    if its already there go to

    1- Run

    2- Regedit

    3- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

    4- edit PATH reg and Add: %SystemRoot%\system32;%SystemRoot%;

    ----------------------------

    if the issue didn't solved use the above so you have repair the OS using windows CD

     
    Monday, March 06, 2017 1:52 PM
  • thanks.. its work for me.
    Tuesday, June 13, 2017 4:02 PM