9
votes

I am on a 64bit Windows 10. I installed Win64 OpenSSL v1.1.0f and added the install directory C:\OpenSSL-Win64\bin to my system PATH. Upon running it in cmd or Powershell, I get:

openssl : The term 'openssl' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

What else am I missing?

2
In a cmd window, if you CD into c:\OpsnSSL-Win64\bin, do you see openssl.exe or openssl.bat or openssl.cmd in that directory? If you do, does it run from that directory? If it runs, your PATH may be malformed somehow. - mao
@mao Ok, from the bin folder, I can run it, but only with ./openssl instead of openssl. In other directories I can't run it in any way. - ulak blade
This suggests your PATH is malformed. Check it carefully , check the separators (usually ;) and if directories have spaces they need to be quoted. - mao
The directory I've put is C:\OpenSSL-Win64\bin\. Putting it in quotes like "C:\OpenSSL-Win64\bin\" doesn't change anything. I also tried remove the last slash, still same thing. I guess I'll have to write the path and exe manually instead of "openssl" - ulak blade
In the cmd window, try SET PATH="c:\OpsnSSL-Win64\bin";%PATH% to deliberately make it the first directory on the PATH. Then run openssl. If it works, open a new CMD window, and compare the PATH values. - mao

2 Answers

21
votes

If you're running it in Powershell, check $env:path to be sure "C:\OpenSSL-Win64\bin" is in there. Previous comments all reference the PATH variable in in cmd.exe, which your error message suggests you are not using.

If it is not, run the following command in Powershell:

$env:path = $env:path + ";C:\OpenSSL-Win64\bin"
1
votes

May be you need to close the session and open a new powershell, whenever you make changes to env variable it does not work on current session.