Reputation: 122
I am running a test.bat
file using the following code in MATLAB.
system('C:\Windows\system32\cmd.exe /K "test.bat"');
I don't want the output to be shown in MTLAB console.Also how can I redirect it's output to a file without using diary
?
Upvotes: 1
Views: 450
Reputation: 18381
Either you can embed the redirection into the command line:
system('C:\Windows\system32\cmd.exe /K "test.bat" > out.txt');
or store the result into variable:
[status, result] = system('C:\Windows\system32\cmd.exe /K "test.bat" );
And then fprintf
the result
to file.
Upvotes: 3