0

On Ubuntu, the default path includes /usr/bin, which is where most system applications are installed via sudo. The equivalent on Windows is C:\Program Files, protected by UAC. (Of course, it's more complicated than that.)

On Ubuntu, the default path also include ~/.local/bin (kinda), which is where you can drop user applications, for example a Python script you can invoke from anywhere. sudo is not required in any part of the process.

Is there an equivalent to ~/.local/bin on Windows? A user folder already on the path where you could drop an EXE, open the terminal, navigate to any folder, and invoke the EXE, all without triggering UAC. Alternatively, is there a de facto convention?

lofidevops
  • 1,378

3 Answers3

1

I don't think that there is an exact equivalent to Ubuntu's ~/.local/bin on Windows. However, you can achieve somewhat the same effect by creating a folder for your scripts and executables and adding it to the PATH environment variable.

I do this on my Windows machines:

  • I create a folder for my scripts like C:\Users\<Username>\scripts
  • Then I go to Environment Variables and add the above folder to the PATH variable

Now, I can put my scripts in the above folder, and they will be accessible from the command prompt regardless of the current working directory. This method essentially creates a user-level PATH entry similar to ~/.local/bin on Ubuntu.

Bilesh Ganguly
  • 1,049
  • 1
  • 7
  • 16
0

Do not try to match the directory/folder systems of Windows and Linux. They are so different so you can hardly find anything to compare.

Moreover you rarely need to exec something from command line because most of the things have "shortcuts" in start menu.

I personally use: c:\tools and add it in to the PATH.

Romeo Ninov
  • 7,848
0

No, there isn't one. You can freely create one by editing environment variables and adding any directory to the PATH var. E.g. people recommend C:\tools for some reason, I personally think it's a bit messy location. User-based it would be e.g. C:\Users\[user]\Tools or any other directory that you choose inside the [user] folder.

Also, if you install Chocolatey package manager then that includes a similar folder where all executables that should be in PATH are stored by shimming: C:\ProgramData\chocolatey\bin

I would strongly recommend going for that approach, it saves a lot of time, although scripts for some apps (like Ghostscript) don't do shimming. I'd say ~95% of executables that I'd want to be in PATH are handled properly. Plus of course you get the regular advantages of a package manager.

Destroy666
  • 12,350