Trouble when calling a bat file

6 ビュー (過去 30 日間)
Kfir Weissman
Kfir Weissman 2022 年 3 月 1 日
コメント済み: Kfir Weissman 2022 年 3 月 1 日
i have a python script that running perfectly using the anaconda env.
i created a bat file that call to my python script, and when i double clicking the bat file it running perfectly also.
also when i call to the bat file from cmd it works fine.
BUT, when i call to the bat file from matlab2021a usung the system() it gives this error message:
"'cmd' is not recognized as an internal or external command,
operable program or batch file."
and also:
"RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning) "
By the way, i alread add my PATH to matlab.
The biggest thing is that last night i could have run the bat file from matlab, woke up this morning and got that issue before change nothing:(
Hope for answers:) Thanks
  11 件のコメント
Walter Roberson
Walter Roberson 2022 年 3 月 1 日
Which operating system are you using? Which MATLAB release are you using?
If you are using Windows, then check inside C:\Windows\System32 to see if cmd.exe is there.
What shows up in MATLAB if you ask
getenv('PATH')
Kfir Weissman
Kfir Weissman 2022 年 3 月 1 日
編集済み: Kfir Weissman 2022 年 3 月 1 日
Guys i solve the problem, I just restart matlab and its work..

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2022 年 3 月 1 日
Actually I don't think this will work (what you say you are using):
system(myBat.bat)
You either have to pass in a variable, or pass in your batch filename enclosed in single or double quotes:
system("myBat.bat")
  1 件のコメント
Kfir Weissman
Kfir Weissman 2022 年 3 月 1 日
I fix it, thanks!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by