Why does set command shows different value of PATHEXT variable than what's in the registry?

1

I'm on Windows Vista x64.

C:\Users\Piotr>set pathext
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.JS;.WS;.MSC

As far as I know value of PATHEXT environment variable is saved in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment and HKEY_CURRENT_USER\Environment keys under PATHEXT entry. In my case the first entry is .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW and the second one does not exist.

Why there's a difference between what set command shows and what's in the registry?

Piotr Dobrogost

Posted 2011-10-01T12:33:37.530

Reputation: 4 413

Answers

0

In my question I stated

In my case the first entry is .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW and the second one does not exist.

which wasn't true. In fact I had HKEY_CURRENT_USER\Environment\PATHEXT entry and it was empty. It looks like having this entry empty somehow resets PATHEXT to some default value effectively eliminating any extra values added to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PATHEXT.

Piotr Dobrogost

Posted 2011-10-01T12:33:37.530

Reputation: 4 413

The 'default' string you are seeing matches the PATHEXT policy template. Do you have a Domain Policy setting or Local Policy setting for PATHEXT? – user165568 – 2014-10-22T00:02:59.900

The user environment overrides (has a higher priority than) the system environment. – Synetech – 2012-02-24T06:36:29.917