MATLAB Answers

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

2 views (last 30 days)
Shazed Tashrif
Shazed Tashrif on 27 Mar 2020
Answered: Anurag Agrawal on 30 Mar 2020
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?

  0 Comments

Sign in to comment.

Answers (1)

Anurag Agrawal
Anurag Agrawal on 30 Mar 2020
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:

  0 Comments

Sign in to comment.

Tags

Products


Release

R2019a