Problem in Path settings - Windows7
In Windows7 the Path command does not work unless the actual location is shown: For computer1 "Mary" with Windows7 (32-bit) the 'Run...' option can use either 'cmd.exe' or 'command.com' for a prompt. Entering the command 'attrib' gave "attrib is not recognised..." etc. The existing path included "Path=%SystemRoot%\system32; ..." etc which is where attrib.exe was located. A new path 'path=C:\Windows\system32\' was then entered and confirmed and then 'attrib' worked corrrectly.For computer2 "Zlazz" with Windows7 (64-bit) 'attrib' worked properly straight off. Its path was "PATH=C:\Windows\system32; ..." etcObviously the difference in "Path=..." format is causing the problem so any batch files using DOS-type commands that won't operate should start with PATH=C:\Windows\system32\. Checking the System Properties/ Advanced/ Environment Variables on the 32-bit computer found that the two user profiles there each showed Path as "C:\Windows\System32\; C;\Windows;..." so the string "Path=%SystemRoot%\system32;..." evidently comes from somewhere else. What needs to be done so that the path parameter receives the actual location address instead of this "%SystemRoot%" setting?
January 12th, 2010 2:47pm

Hi Zlazz, Thanks for using Microsoft Answers! I'm moving your thread to the Windows 7 Misc forums in the TechNet community. They'll be able to better assist you there.Cody C Microsoft Answers Support Engineer Visit our Microsoft Answers Feedback Forum and let us know what you think.
Free Windows Admin Tool Kit Click here and download it now
January 13th, 2010 5:34am

I suspect something, such as a software install, has changed the Path setting in the Registry for either the user or the system.The default Path is in fact %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\system32\Wbem. But it needs to be Registry Type REG_EXPAND_SZ.Non-standard software installs sometimes use the wrong method to change the Path, resulting in this problem.Sometimes they wrongly put themselves first on the Path. I just checked mine and found "C:\Program Files\Common Files\Microsoft Shared\Windows Live" first, which was actually "%CommonProgramFiles%\Microsoft Shared\Windows Live", set as first in both curent user (HKEY_CURRENT_USER\Environment) and system (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment).Go figure, non-conformance from a Microsoft product. Or, to put it another way, do as I say, not as I do.
January 13th, 2010 6:23am

Solution:Following the advice from Brian Borg I went to the two references in the Registry for Windows7 (64-bit) where the Path was shown and both had variables in their address as follows: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0; There were other references however they were shown as actual addresses (eg 'C:\Program Files\...' etc). The Registry Type was REG_SZ but Internet information was too confusing on how to change this to Brian's advised REG_EXPAND_SZ (which allows for these %...% variables) so I replaced each '%SystemRoot%' on the Path settings with 'C:\Windows' and rebooted. Using cmd.exe in the 'Run...' option got to a prompt. Previously entering cmd.exe again would get "cmd.exe is not recognised as an internal or external command, operable program or batch file". Following the Registry change however the various command options in C:\Windows\system32 now run from the prompt as required and the full amended path is also present.Sorting this out now allows batch files containing commands located in the C:\Windows\system32 folder to run properly so thanks for the valuable information.
Free Windows Admin Tool Kit Click here and download it now
January 16th, 2010 1:12pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics