{"id":4094,"date":"2016-09-20T11:19:05","date_gmt":"2016-09-20T05:49:05","guid":{"rendered":"http:\/\/198.58.113.91\/blog\/?p=4094"},"modified":"2019-05-12T02:53:45","modified_gmt":"2019-05-12T02:53:45","slug":"windir-not-resolved-recognized-fix-env-variable","status":"publish","type":"post","link":"https:\/\/www.winhelponline.com\/blog\/windir-not-resolved-recognized-fix-env-variable\/","title":{"rendered":"Windir Path Not Resolved or Recognized. How to Fix the Environment Variable?"},"content":{"rendered":"<p>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.<!--more--><\/p>\n<p>If %Windir% is not recognized or resolved by the system, your batch scripts that use the variable would fail to run correctly.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/09\/windir-2.png\" alt=\"windir not resolved or recognized\" width=\"344\" height=\"97\" class=\"alignnone size-full wp-image-4096\" \/><\/p>\n<p>Also, the tasks pane in various places such as Control Panel, and modern Settings app point to application paths referencing <code>%Windir%<\/code>. If this variable is broken, clicking those links would cause the following error:<\/p>\n<div class=\"err\">Windows cannot find %windir%. Make sure you typed the name correctly, and then try again.<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/09\/windir-5.png\" alt=\"windir not resolved or recognized\" width=\"271\" height=\"249\" class=\"alignnone size-full wp-image-4099\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/09\/windir-1.png\" alt=\"windir not resolved or recognized\" width=\"558\" height=\"133\" class=\"alignnone size-full wp-image-4095\" \/><\/p>\n<p>Here is how to fix the problem.<\/p>\n<h2>Create or Fix Windir Environment Variable<\/h2>\n<p>Press WinKey + R, type <strong>sysdm.cpl<\/strong> and press ENTER<\/p>\n<p>From the Advanced tab, and click Environment variables.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/09\/windir-3.png\" alt=\"windir not resolved or recognized\" width=\"412\" height=\"468\" class=\"alignnone size-full wp-image-4097\" \/><\/p>\n<p>In the System variables section, create a new variable by clicking <strong>New<\/strong>. If the <code><strong>Windir<\/strong><\/code> variable already exists, double-click to edit the existing one.<\/p>\n<p>Name the variable as <code>windir<\/code>, and set the value as <code>%SystemRoot%<\/code><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/09\/windir-4.png\" alt=\"windir not resolved or recognized\" width=\"616\" height=\"519\" class=\"alignnone size-full wp-image-4098\" \/><\/p>\n<p>Click OK, OK. Changes are applied instantly. If not, logoff and login back.<\/p>\n<h2>Path Length Issue<\/h2>\n<p>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&#8217;s site: <a target=\"_blank\" href=\"https:\/\/software.intel.com\/en-us\/articles\/limitation-to-the-length-of-the-system-path-variable\" rel=\"noopener noreferrer\">Limitation to the length of the System PATH variable | Intel\u00ae<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[7],"tags":[],"class_list":["post-4094","post","type-post","status-publish","format-standard","hentry","category-windows"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1693,"url":"https:\/\/www.winhelponline.com\/blog\/restore-admin-tools-shortcuts-windows-10\/","url_meta":{"origin":4094,"position":0},"title":"Restore Missing Administrative Tools Shortcuts in Windows 10","author":"Ramesh","date":"February 28, 2016","format":false,"excerpt":"The Administrative Tools folder in the Start menu contains a list of shortcuts to launch admin tools like Perfmon, Resmon, Computer Management, Registry Editor, etc.\u00a0If your Administrative Tools folder is empty, use one of these ways to restore the default shortcuts. Method 1: Restore missing shortcuts using SFC The default\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"admin tools shortcuts sfc.","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/02\/sfc-scanfile-admin-tools.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/02\/sfc-scanfile-admin-tools.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/02\/sfc-scanfile-admin-tools.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":79110,"url":"https:\/\/www.winhelponline.com\/blog\/default-system-and-user-environment-variables\/","url_meta":{"origin":4094,"position":1},"title":"List of SYSTEM and USER Environment Variables","author":"Ramesh","date":"July 25, 2025","format":false,"excerpt":"Windows has a default set of environment variables and their values. There are two types of environment variables: user environment variables (set for each user) and system environment variables (set for everyone). For example, the variable %USERNAME% represents the name of the currently logged-on user account. If you have inadvertently\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":59342,"url":"https:\/\/www.winhelponline.com\/blog\/commands-not-recognized-internal-external-command\/","url_meta":{"origin":4094,"position":2},"title":"Commands not recognized as an internal or external command in Command Prompt","author":"Ramesh","date":"July 12, 2023","format":false,"excerpt":"When you run a command-line in a Command Prompt window, the following error may appear: 'help' is not recognized as an internal or external command, operable program or batch file. This happens even if the respective executable file is located in the Windows or System32 folder, such as help (help.exe),\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"move windows and system32 to the top of the path variable","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2023\/07\/path-variable-change-order.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2023\/07\/path-variable-change-order.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2023\/07\/path-variable-change-order.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2023\/07\/path-variable-change-order.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1280,"url":"https:\/\/www.winhelponline.com\/blog\/display-build-info-version-windir-windows-8-10\/","url_meta":{"origin":4094,"position":3},"title":"How to Display Build Info, Edition and WinDir Path on the Desktop","author":"Ramesh","date":"December 1, 2013","format":false,"excerpt":"Here is a neat little registry edit for Windows 8 and Windows 10 systems that shows the build information and Windows version on the lower right corner of the desktop as a watermark. The good old PaintDesktopVersion registry edit still works in Windows 8 and Windows 10, but there is\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/archived2\/w8-displayversion.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":30783,"url":"https:\/\/www.winhelponline.com\/blog\/dism-exe-not-recognized-cmdlet-ps\/","url_meta":{"origin":4094,"position":4},"title":"[Error] Dism.exe is not recognized as the name of a cmdlet","author":"Ramesh","date":"December 11, 2022","format":false,"excerpt":"When you run a DISM.exe command-line in PowerShell, the command may not be recognized. The following error is shown when you do so: dism.exe : The term 'dism.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"dism.exe not recognized - add system32 to PATH","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/12\/dism-system32-path-missing-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/12\/dism-system32-path-missing-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/12\/dism-system32-path-missing-1.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":26688,"url":"https:\/\/www.winhelponline.com\/blog\/restore-path-environment-variable-deleted\/","url_meta":{"origin":4094,"position":5},"title":"How to Recover PATH Variable After Deleting it Accidentally","author":"Ramesh","date":"May 18, 2022","format":false,"excerpt":"The PATH is a variable that Windows uses to locate needed executables, especially from the command line. Unfortunately, there are situations where users accidentally delete the PATH variable. This can happen when users inadvertently overwrite the PATH data rather than appending them. There are also cases where some buggy applications\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"recover path environment variable - shadow copy hive","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/05\/recover-path-variable-shadowcopy.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/05\/recover-path-variable-shadowcopy.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/05\/recover-path-variable-shadowcopy.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/4094","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/comments?post=4094"}],"version-history":[{"count":0,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/4094\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/media?parent=4094"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/categories?post=4094"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/tags?post=4094"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}