Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Sending commands to running dos application

Subject: Sending commands to running dos application

From: Andrew Polgreen

Date: 7 Feb, 2008 13:44:01

Message: 1 of 2

I know it is possible to execute DOS programs from within
matlab with specific inputs. However, I would like to be
able to run a program and then send commands to the
program itself, which would allow me to script a very
tedious process of going through menus and entering the
same data each time. Is there any way to actually send
commands to a program once it has been called with the DOS
command?

Subject: Sending commands to running dos application

From: Tommie Heard

Date: 7 Feb, 2008 15:33:06

Message: 2 of 2

"Andrew Polgreen" <andrew.polgreen@gmail.com> wrote in
message <fof1v1$t7v$1@fred.mathworks.com>...
> I know it is possible to execute DOS programs from within
> matlab with specific inputs. However, I would like to be
> able to run a program and then send commands to the
> program itself, which would allow me to script a very
> tedious process of going through menus and entering the
> same data each time. Is there any way to actually send
> commands to a program once it has been called with the
DOS
> command?

Here is are two examples of executing a DOS command from
within an m-file.

1) DosCommand = ['echo off |dumppod16.exe ',dumpfil];
[ErrorExist, Result] = dos(DosCommand);

2) [s, w] = dos('cscript c:\windows\system32\prnmngr.vbs -
l');

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us