I recently installed a software package called GPSToolkit on my Windows machine. The bin directory was automatically added to my PATH and I can execute the GPS functions from any directory. However, when I attempt to make a system call within Matlab none of the functions in the GPS toolkit can be found. The specific error message reads "'rinexpvt' is not recognized as an internal or external command, operable program or batch file."
Does Matlab have a different set of environmental variables? Maybe the operating system considers Matlab to be a different "User"? Any ideas would be greatly appreciated! Thanks in advance --Dom.
You can specify the fully qualified path in your system call
You can check and modify the system path with getenv() and setenv()
check http://www.mathworks.com/help/techdoc/ref/setenv.html for examples
setenv('PATH', [getenv('PATH') '; C:\the\path\to\your\tool']);
Related
I've been having difficulty setting up lua as a system path. I'm attempting to run lua programs via the command prompt. I've followed multiple stackoverflow answers for similar questions:
Running a lua program from a text file
to no avail. Regarding the link's four steps: I'm able to complete step one no problem, would like to complete step three and step two onward have thoroughly confused me.
I've edited my PATH variable to include what I believe the correct path for lua is: C:\Program Files\Lua\5.3.4_64\lua53.exe. I feel like this is where I'm botching it.
This is the general output when I try to run lua from a cmd prompt within the folder holding lua.exe or outside of it.
C:\Program Files\Lua\5.3.4_32>lua main.lua
'lua' is not recognized as an internal or external command,
operable program or batch file.
If anyone can help or needs more information to help please let me know and thank you in advance.
You need to add the folder of lua53.exe to the PATH variable. That is, add C:\Program Files\Lua\5.3.4_64, not C:\Program Files\Lua\5.3.4_64\lua53.exe. Then when you type lua53 in the command prompt, the command processor will search in that folder for lua53.exe and run it.
If you want to run Lua in the command line with the name lua, you will have to rename lua53.exe to lua.exe, or create a batch file named lua.bat with the content lua53 %* and save it in the same folder as lua53.exe. (%* is a variable that copies the arguments that you typed after the name of the batch file. That is, if you type lua -e "print 'Hello, world!'" in the command line, it will execute the command lua53 -e "print 'Hello, world!'".)
I'm trying to use Cygwin to run some astrophysics code called FAST through a program called IDL. In order to do this, I need to set environment variables for the installation path of IDL and the directory of IDL. When I go to the system variables tab in the system settings, I name the variable as appropriate and set the value to C:\Program Files\Exelis\IDL85, but I get an error saying that
STUDENT#SES-6TTJK72 /cygdrive/c/Users/Administrator/Downloads/FAST_v1.0/FAST_v1.0/example_phot
$ ../fast
../fast C:\Program Files\Exelis\IDL85 .:+C:\Program Files\Exelis\IDL85/lib
../fast: line 6: C:\Program: command not found
Now this seems to be happening because Cygwin can't read the space in Program Files as space is used to delimit the arguments, but I've tried every solution I can think of to get around this. I've tried Program\ Files, I've tried quotes around the whole thing, etc. I was just wondering if there was some way to set the windows environment variables in Cygwin itself so I can just type the path out in the notation that Cygwin uses and it would be able to understand it for sure. Any help on this would be much appreciated!
I would like to ask you if it's normal that my "Setting environment" changes after each system reboot or even if I just close my cmd console.
for example, I'm using python 3.5, when I wan to use python or to uses pip under the cmd I got an error like :
C:\>python
'python' is not recognized as an internal or external command,
operable program or batch file.
To fix this, I use :
set PATH=%PATH%;C:\Python35
It works after, but as I said before, once I restart my computer, or I close the console, I've the same problem !!!
Thanks in advance for your help and comments. I just would like to inform you that I'm using Windows 7 - 64bits.
You need to add this path in System (Windows+Pause key), Advanced, Environment variables. There you have two sections, System and User, in System, edit the PATH key.
The next time you start a console the path will be present.
Alternaly, if you don't want to modify the setting there (or you have no rights) you could start the app with a batch file which sets the path before launching the app.
In Ruby you can adapt the environment variables from within the script itself by using ENV eg ENV['path'] += 'C:\\Python35'
, I'm sure Python can do this too but wouldn't know how. In your use case this won't help of course.
The SETX command will set the variable permanently. Use SETX /? for information. Set a persistent environment variable from cmd.exe
For Python, many developers use venv which is included with the Python install. https://docs.python.org/3/library/venv.html?highlight=venv#module-venv
I've installed Ruby and in the User Variables, I can see that Path = C:\Ruby22-x64\bin
However, when I run ruby in the cmd, it says 'ruby' is not recognized as an internal or external command, operable program or batch file.
I've accidentally deleted the Path in System Variables and I think that's why it's not working.
Could anyone guide me on how to restore or add the Path in the System Variable?
Thank you in advance!
The default value is:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
I am making a portable minecraft that works completely off a flash drive, including java. At my home computer the .bat file works perfectly, however on the school computer it does not run and gives me "java is not recognized as an internal or external command, operable program, or batch file" leading me to believe that the batch is looking for java on the local computer as apposed to my intentions of using the java portable installed on the flash drive.
Here is my code.
#echo off
Title Do not close this window
set APPDATA=%CD%\mcp_data
set JAVA_HOME=%CD%\mcp_data\Java\bin
java -Xmx3072M -jar "%CD%\mcp_data\launcher\MineCraft.jar"
You never set the PATH variable to include java anywhere. Your home system knows where to find a copy of java (because it's most likely installed on your machine too) but the school system doesn't.
So you can either try and change the path variables on the school computer (which you may or may not have the rights to do, and it leaves a trail they might not like), or you can make your bat file refer to the copy of Java on the flash drive by it's full path name, i.e. %CD%\mcp_data\Java\bin\java.exe or whatever the path of the java executable is.
I recommend using the full path name since it's in a bat file, so the fact that it's longer doesn't really matter.
See below.
#echo off
Title DO NOT CLOSE THIS WINDOW!!! Closing this window will force close MineCraft
set APPDATA=%CD%/mcp_data
"%CD%\mcp_data\Java\bin\java.exe" -Xmx3072m -Dorg.lwjgl.opengl.Display.allowSoftwareOpenGL=true -jar "%CD%\mcp_data\launcher\MineCraft.jar"