How to run an exe file and save the outputfile generated to a different folder?

조회 수: 3 (최근 30일)
executefile = fopen('ENTER.txt','w');
fprintf(executefile,strcat('\n','\n','\n','\n'));
fclose(executefile);
system('my.exe < ENTER.txt');
I am trying to execute my.exe that requires 4 enter to run. After running the program, it generates some file in the current folder, how can I direct these files to a different folder?

답변 (1개)

Anurag Agrawal
Anurag Agrawal 2020년 3월 30일
Hi
You can use movefile function to move your file to the desired folder
movefile source destination
For more details, you can check the documenation page:

카테고리

Help CenterFile Exchange에서 MATLAB Code Analysis에 대해 자세히 알아보기

태그

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by