Pass filename to windows batch (.bat) script when double clicking so that it will run in octave

天大地大妈咪最大 提交于 2019-12-06 13:42:31

Try this batch file, which will echo a few specific items:

@echo off
echo My directory %cd%
echo Batchfile Name %0
echo File to run %1
pause  

So %1 parameter will provide you with the filename itself.

You can also use it like this.

@echo off
echo My directory %cd%
echo Batchfile Name %~dpnx0
echo file to run %~dpnx1
pause

So in Short, this should work if you are running this the way I am thinking you do.

C:\Octave\Octave-4.2.1\octave.vbs --no-gui --persist --eval myOctaveFunction('%1')
pause
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!