2

So I know about the PATH variable, but it's not there. Why can I type "notepad++" in cmd and it will work and how can make other apps work like this?

The question is not HOW to start it via win+r run, but WHY can I start it right after installation without putting notepad++ directory to path variable.

EDIT1:
Added screenshots for path variables

Current user:
Current user

System:
System

EDIT2: cmd echo %path%

C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Embarcadero\Studio\20.0\bin;C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl;C:\Program Files (x86)\Embarcadero\Studio\20.0\bin64;C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl\Win64;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files (x86)\GitExtensions\;C:\Program Files\php-7.3.4-Win32-VC15-x64;C:\xampp\php;C:\ProgramData\ComposerSetup\bin;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;C:\Users\deadman\AppData\Roaming\Composer\vendor\bin

ymdred16
  • 53
  • 1
  • 8
  • Possible duplicate of [How do I start Notepad++ from cmd?](https://superuser.com/questions/607379/how-do-i-start-notepad-from-cmd) – Ramhound May 14 '19 at 13:57
  • 1
    Use `echo %PATH%` in Command Prompt to inspect the *actual* contents of PATH. – Daniel B May 14 '19 at 13:57
  • If the path to Notepad++ does not exist in the Path variable that is the exact reason it isn't working the way you want it to work. – Ramhound May 14 '19 at 14:02
  • Well, as I have stated there is NO path variable for notepad++ directory, I can add screenshots if needed. Neither there is notepad++ shortcut in windows or system32 folders. – ymdred16 May 14 '19 at 14:02
  • @Ramhound well it works. and that's the reason i'm asking about it. Why does it? – ymdred16 May 14 '19 at 14:04
  • @ymdred16 Is it possible that you have different paths defined in an administrator vs. non-admin command prompt? – raphael75 May 14 '19 at 14:12
  • @ymdred16 Also, this may be an obvious question, but do you happen to be in the same folder that notepad++ is in when you start it? – raphael75 May 14 '19 at 14:14
  • Please provide screenshots. – Ramhound May 14 '19 at 14:21
  • @raphael75 1) how do i check it? 2) no, i've tried running it from anywhere and it seems to work. – ymdred16 May 14 '19 at 14:31
  • @Ramhound added screenshots for path variables – ymdred16 May 14 '19 at 14:32
  • 3
    Again: Please use `echo %PATH%`. Also, use `where notepad++` to see where it is picked up. Only then can we start to check where this folder is added to `%PATH%`. – Daniel B May 14 '19 at 14:36
  • @DanielB added screenshot and text from "echo %path%". Also `where notepad++` results in "INFO: Could not find files for the given pattern(s)." – ymdred16 May 14 '19 at 14:46
  • If you do a search on your harddrive(s) for notepad++.exe, is it possible that it's in one of those folders? It seems like even though you may have it installed in the default location that somehow the executable got copied to one of the folders that's in the path. – raphael75 May 14 '19 at 14:50
  • @raphael75 Definitely not. Just have checked every folder stated in any environment variable. – ymdred16 May 14 '19 at 15:06
  • @ymdred16 I wonder if there may be a shortcut file that it's finding? I'm running out of ideas. :) What version of windows are you using? – raphael75 May 14 '19 at 16:24
  • @raphael75 win10 latest update, no shortcuts) i can also run opera, chrome and some other apps this way too. Wondering how it works. – ymdred16 May 14 '19 at 17:15
  • Could you try doing a search on .lnk files (those are the shortcut files)? It's possible there are .lnk files for all the programs you're able to run in one of the paths in the PATH environment variable. Right now I can't think of anything else that would make this work. – raphael75 May 14 '19 at 17:19
  • 1
    seems like i found the answer, thank you all for your help :) – ymdred16 May 14 '19 at 17:37

1 Answers1

0

Mose likely because some apps and programs add their paths to registry. Here you can find more about searching order for starting apps via cmd or win+r. These paths are stored in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths Here you can find more about application registration on Microsoft docs.

ymdred16
  • 53
  • 1
  • 8