How to get name of the standalone application with .exe extension while it is executing?

I have a standalone application, which is invoked with-
matlabXX.exe 'abc.txt'
Now when it is executing, I can get 'abc.txt' using vararg but how can I get 'matlabXX.exe'?

1 件のコメント

Steven Lord
Steven Lord 2023 年 3 月 14 日
How were you hoping to use this information if you were able to get it?

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

回答 (2 件)

Walter Roberson
Walter Roberson 2023 年 3 月 14 日

0 投票

Using .exe implies MS Windows.
You can use System.Diagonstics.Process and related facilities methods to find your current process identifier and use that to find the name of your process.
Image Analyst
Image Analyst 2023 年 3 月 14 日

0 投票

See attached utility that I use to get the filename of the executing standalone executable.

カテゴリ

ヘルプ センター および File ExchangeGet Started with MATLAB についてさらに検索

製品

リリース

R2022b

質問済み:

2023 年 3 月 14 日

回答済み:

2023 年 3 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by