2

I need to execute gnuplot from the Windows cmd, however, when I type in gnuplot, I get the error:

“gnuplot” is not recognized as an internal or external command, operable program or batch file.

When I installed the program I remember using the default settings, as shown in the following screenshots:

enter image description here

enter image description here

I am afraid that those settings are now preventing me from executing gnuplot from cmd. Is this correct? What can I do to solve the problem?

2

Indeed, during the installation I should have checked the "Add application directory to your PATH environment variable" option.

I preferred a clean install instead of adding the PATH variable manually. So I uninstalled gnuplot completely and reinstalled it again, making sure that I checked the option this time. All this took me less than 1 minute.

Now I can execute gnuplot from cmd correctly.

0

You need to add your new program to the environment path like this:

1.From the desktop, right-click My Computer and click Properties.

2.In the System Properties window, click on the Advanced tab.

3.In the Advanced section, click the Environment Variables button.

4.Finally, in the Environment Variables window, highlight the Path variable in the Systems Variable section and click the Edit button. Add or modify the path lines with the paths you wish the computer to access. Each different directory is separated with a semicolon.

For example, if the "gnupilot.exe" is in the C:\Program\gnupilot" you need to add "C:\Program\gnupilot;" at the end of path variable:

enter image description here

0

You can only execute commands which exist in one of the folders specified by the Path environment variable. So unless you specify the full path to gnuplot.exe, you can't run it if it's not in Path. If you are using Windows 10, you can right-click the start menu, click on System > Advanced System Settings > Environment Variables. You will see that there are two types of environment variables, user variables and system variables. User variables are environment variables which applies only to the current user, while system variables apply to the whole system. If you want gnuplot to be in Path regardless of the user account you are using, look for the system variable Path and you will see a semicolon-separated list of file system locations. Add the location of the folder where gnuplot.exe exists, and you will be able to use gnuplot from cmd. Similarly, if you only want to apply changes only to the current user, go ahead and add Path to your user variables, with the location of the folder where gnuplot.exe exists as its value.

EDIT: I guess you could more simply check "Add application directory to your PATH environment variable" when installing gnuplot.

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.