フィルターのクリア

run matlab file from cmd prompt if matlab is already open

2 ビュー (過去 30 日間)
Tanner
Tanner 2016 年 1 月 11 日
Hi,
I'm working on a batch file that lets the user run a matlab program directly from the desktop. However, I want to avoid opening a second instance of matlab if it's already running. My batch file is an if else statement based on whether or not matlab is already running. My question is how can you run the .m file from the batch file, by using the instance of matlab already running?
The line I need help with is in the *???***
tasklist /FI "IMAGENAME eq MATLAB.exe" /NH | find /I /N "MATLAB.exe" >NUL
if "%ERRORLEVEL%"=="0" (
****???****
) ELSE (
cd C:\program files\matlab
matlab -sd N:\matlab -r mfile
)
Thanks!

回答 (0 件)

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by