Suppose that you need to run some program, for example
directly from the command line.
Without preliminary preparation, entering Firefox into the console will throw an error.
'firefox' is not recognized as an internal or external command, operable program or batch file.
Right Click This PC → Properties
Advanced system settings
Advanced → Environment Variables
There is a faster way to reach this point - you can press Win button and type PATH in the search field.
If you plan to change variable for the whole system
find PATH line in
select it and click «Edit...»
If you plan to change it only for your user - concentrate on «User variables for %USERNAME%»
Paste or type in the folder address where the executable file is located. In our example it is C:\Program Files (x86)\Mozilla Firefox
Restart the command window or run a new one and type firefox there.
Browser should start now.
You can check the list of variables by running set command
without additional parameters. As an output you will get both system and user variables plus additional information. PATH content is colored with green.
Most likely you are trying to add
Windows like address to unix PATH
with all spaces, brackets etc.
andrey@olegovich-10:/usr/share$ export PATH=/mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath_target_1128437:$PATH
-bash: syntax error near unexpected token `('
To avoid this error you need to screen
spaces and brackets
. If multiple PATH are imported and the input is long
probably it is easier to write PATH=$PATH:/path , and path will be added to the end of
You should keep in mind that all unnecessary additional spaces will brake the import. To check if your import is ok you can check it in text editor by puting it to single screen.
Also keep in mind that even if you are working in bash for Windows , system variable should be set via Windows. Or they will be lost after cmd restart
andrey@olegovich-10:/usr/share$ export PATH=$PATH:/mnt/c/Program\ Files\ \(x86\)/Common\ Files/Oracle/Java/javapath_target_1128437
Example of using psql from
bash for Windows
- it can help if you want to temporarly add
path psqk to PATH variable to run
In this example psql.exe is in the C:\Program Files\PostgreSQL\12\bin folder
|-||RDP access from Windows via SSH tunnel|
|🄭||Access to remove CDROM via RDP|
|-||Installing Windows on GPT disk|
|-||Developer Mode in Windows 10|
|-||Adding Scripts to Autostart|
|-||Environmental variable PATH|
|-||Bash in Windows 10|
|-||Grep, sed, awk|
|📀||Burning Images with Ultraiso|
|-||List of Installed Drivers in Windows|