I find a interesting function when using an exe program. But i don’t know how to relaize this function.
The location of this program is in C:toolmfunction.exe. And a bat file is established in E:data to call mfunction.exe. Write in bat file:
C:toolmfunction.exe data.txt
The data.txt is in E:data.
Under the condition of ensuring that bat and txt files are in the same folder, can exe obtain the file path and read the file only through the file name of data.txt?
This exe program is compiled by C or matlab.
I tried to realize this funtion with matlab but fialed. I don’t know how to get the bat file path.
in addition,this exe program only work when the bat and exe file is in the same folder. Therefore, this program may obtained the address of bat file by some means.
Yeguang Yan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.