0

On my Windows 10 computer, when I display the 'path' environment variable in a command window, there's an extra folder at the end. It's a folder that I once used, but some time ago I deleted the folder and removed it from the 'path'.

The normal GUI for displaying and editing the path shows the value I expect, but the value shown in a command window is as though I'd executed a command

set path=%path%;c:\xyz

I can't find 'c:\xyz' when I search the registry, and there seems to be no 'autorun' associated with the 'Command Processor'.

I tried creating a new shortcut for cmd.exe, but it made no difference.

However, when I run the command prompt as administrator, the unwanted folder isn't shown.

Where can the extra entry be coming from?

1 Answer 1

0

I suspect your search through the registry may have failed due to backslashes needing to be escaped. See if you can find XYZ by running the following from a command prompt:

REG QUERY "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PATH

REG QUERY "HKEY_CURRENT_USER\Environment" /v PATH

If you don't like mucking with the common tools designed to manipulate the registry, your operating system may have a SETX command that is rather specific to working with environment variables.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .