Windir Path Not Resolved or Recognized. How to Fix the Environment Variable?

SystemRoot and Windir are two built-in environment variables that point to your Windows directory. Although both are built-in variables, SystemRoot variable is read-only, but Windir variable can can be removed or edited, and its setting is stored in the registry.

If %Windir% is not recognized or resolved by the system, your batch scripts that use the variable would fail to run correctly.

windir not resolved or recognized

Also, the tasks pane in various places such as Control Panel, and modern Settings app point to application paths referencing %Windir%. If this variable is broken, clicking those links would cause the following error:

Windows cannot find %windir%. Make sure you typed the name correctly, and then try again.

windir not resolved or recognized

windir not resolved or recognized

Here is how to fix the problem.

Create or Fix Windir Environment Variable

Press WinKey + R, type sysdm.cpl and press ENTER

From the Advanced tab, and click Environment variables.



windir not resolved or recognized

In the System variables section, create a new variable by clicking New. If the Windir variable already exists, double-click to edit the existing one.

Name the variable as windir, and set the value as %SystemRoot%

windir not resolved or recognized

Click OK, OK. Changes are applied instantly. If not, logoff and login back.

Path Length Issue

This problem can also occur if the PATH length exceeds 2048 characters (or 4096 chars in Windows 7 and higher). Make sure you remove unneeded entries from PATH to keep it within the limit. For more information, check out article at Intel’s site: Limitation to the length of the System PATH variable | Intel®.


One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support. It won't take more than 10 seconds of your time. The share buttons are right below. :)

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a consecutive ten-time recipient of the Microsoft Most Valuable Professional award in the Windows Shell/Desktop Experience category, from 2003 to 2012. He loves to troubleshoot and write about Windows. Ramesh founded Winhelponline.com in 2005.

4 thoughts on “Windir Path Not Resolved or Recognized. How to Fix the Environment Variable?”

  1. I don’t Know whatever you have written it’s not working with my System.Please write something else if you have proper solution.

    Reply
  2. What about PS, Ramesh?. Your solution works when I enter ‘cmd’ command (as Admin)
    but doesn’t as I enter PS (as Admin)….
    cd %windir% adds the string to the end of current path and creates non cxisting path…….
    ObjectNotFound C:\windows\System32\%windir%….

    Regards 🙂

    Reply

Leave a Reply to Ankit Singh Cancel reply