I want to modify the User Path variable, let's say with "C:\Program Files\Sublime Text 3", which contains subl.exe, so I can use subl in a command prompt. I cannot modify the system environment path, so I have to do it via the user environment path.

Using setx I could modify the User path variable, if I type echo %path% it shows me that the path to subl was added to the variable, same when I go to 'Edit the user environment variables'. However, still neither subl nor subl.exe are recognized commands.

Following the second answer here, I see that on my pc, the type of Path is "REG_SZ" instead of "REG_EXPAND_SZ", could that be the problem? If so, how can I change that type? If I right-click on the variable and select "Modify", it only gives me the name and the value, but not the type.

I already restarted my pc, also in an administrator-prompt added paths aren't recognized.

Any help would be appreciated!

EDIT: Thanks for the suggestions, echo %path% returns something of the form path1;path2;path3";path1;path2;path3;, those double quotation marks are breaking it I suppose.

  • I assume you have closed the command prompted and reopened it after you change the variable? I assume you have ran the command to modify the variable in an elevated command prompt?
    – Ramhound
    Dec 15, 2020 at 17:10
  • Showing your existing path as seen by "echo %PATH%" from the command prompt might also help. Dec 15, 2020 at 18:56
  • Please don't edit your question to include the answer, answer your own question. Please read Can I answer my own question?
    – DavidPostill
    Dec 19, 2020 at 12:47

1 Answer 1


First, do not change the Registry type of a system variable; that is not the issue. [On my PC, User Path is REG_SZ and System Path is REG_EXPAND_SZ.]

Second, is there an invalid entry in the path, prior to the addition for subl? Parsing of the Path variable stops after an invalid entry.

Third, why not modify the PATH using the GUI? If you need to do that repeatedly, just open Regedit and export HKEY_CURRENT_USER\Environment and run the .reg file when needed.

  • Thanks for the suggestion, I took a closer look when echoing the variable, I noticed it looks (rather oddly) like this: path1;path2;path3";path1;path2;path3; I suppose the double quotation marks are breaking it.
    – Pj0tr77
    Dec 15, 2020 at 18:56
  • @Pj0tr77 - Please provide us the exact output. There shouldn't be any reason we should be left guessing. We cannot diagnose the issue otherwise.
    – Ramhound
    Dec 15, 2020 at 19:07
  • @Ramhound You're right, sorry, I'll do so if there comes a next time
    – Pj0tr77
    Dec 15, 2020 at 19:43
  • Strange; entries in my user path that reference other environment variables were not expanded, and the type of my user's PATH key was REG_SZ. After using "Edit environment variables for your account" to change the order of the entries (i.e., a sort of no-op change), I found that my user's PATH key was now changed to REG_SZ_EXPAND (and the PATH entry now had its environment variable references expanded). So I'd be interested to know whether PATH entries with environment variables are being expanded on your system and/or if the control panel changes the type of the key on your system.
    – Sam Morris
    Oct 27, 2021 at 11:50
  • @SamMorris, interesting! Took a screen shot of Regedit before opening the User Environment Variable in the Windows (v. 20H2) CPL and compared it after opening each item, clicking OK, then clicking OK on the parent dialog -- and there was no change. At the start there were 3 REG_SZ values and 3 REG_EXPAND_SZ, and the same afterwards. Not sure what others might experience, this is a data sample of one user. Oct 27, 2021 at 21:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.