Thread Subject:
execute a batch file in dos from MATLAB

Subject: execute a batch file in dos from MATLAB

From: Moon Datta

Date: 23 Aug, 2012 07:34:07

Message: 1 of 5

I have a batch file namely 'test.bat', which I want to run using matlab. I have used the command " s = dos('test.bat');" . It is not working and giving error with " 'test.bat' is not recognized as an internal or external command,
operable program or batch file. "

How to solve this problem. Please help me.

Thanks in advance

Subject: execute a batch file in dos from MATLAB

From: Christian

Date: 23 Aug, 2012 08:46:07

Message: 2 of 5

Does !test.bat work (having test.bat in your current directory)?


"Moon Datta" wrote in message <k14mdf$pes$1@newscl01ah.mathworks.com>...
> I have a batch file namely 'test.bat', which I want to run using matlab. I have used the command " s = dos('test.bat');" . It is not working and giving error with " 'test.bat' is not recognized as an internal or external command,
> operable program or batch file. "
>
> How to solve this problem. Please help me.
>
> Thanks in advance

Subject: execute a batch file in dos from MATLAB

From: Moon Datta

Date: 23 Aug, 2012 09:53:07

Message: 3 of 5

"Christian" wrote in message <k14qkf$9if$1@newscl01ah.mathworks.com>...
> Does !test.bat work (having test.bat in your current directory)?no this is not working. giving error in "C:\Users\Matlab Programming\Desktop>p all 1681_4.gps 1681_4.txt 'p' is not recognized as an internal or external command, operable program or batch file. "
where p is a program which converts a data to text format.

my test.bat file includes
  "p all a.gps a.txt"

Subject: execute a batch file in dos from MATLAB

From: TideMan

Date: 23 Aug, 2012 11:02:59

Message: 4 of 5

On Thursday, August 23, 2012 9:53:07 PM UTC+12, Moon Datta wrote:
> "Christian" wrote in message <k14qkf$9if$1@newscl01ah.mathworks.com>...
>
> > Does !test.bat work (having test.bat in your current directory)?no this is not working. giving error in "C:\Users\Matlab Programming\Desktop>p all 1681_4.gps 1681_4.txt 'p' is not recognized as an internal or external command, operable program or batch file. "
>
> where p is a program which converts a data to text format.
>
>
>
> my test.bat file includes
>
> "p all a.gps a.txt"

But where does the program p live?
Perhaps you need something like:
"c:\Program Files\This is where p lives\p all a.gps a.txt"

which assumes of course that a.gps and a.txt both live in the pwd, otherwise they should be:
c:\This is where the files live\a.gps
and
c:\This is where the files live\a.txt

Subject: execute a batch file in dos from MATLAB

From: Moon Datta

Date: 23 Aug, 2012 13:28:08

Message: 5 of 5

TideMan <mulgor@gmail.com> wrote in message <2bdce9c7-2519-49a9-9b2b-cc9d3d87639d@googlegroups.com>...
> On Thursday, August 23, 2012 9:53:07 PM UTC+12, Moon Datta wrote:
> > "Christian" wrote in message <k14qkf$9if$1@newscl01ah.mathworks.com>...
> >
> > > Does !test.bat work (having test.bat in your current directory)?no this is not working. giving error in "C:\Users\Matlab Programming\Desktop>p all 1681_4.gps 1681_4.txt 'p' is not recognized as an internal or external command, operable program or batch file. "
> >
> > where p is a program which converts a data to text format.
> >
> >
> >
> > my test.bat file includes
> >
> > "p all a.gps a.txt"
>
> But where does the program p live?
> Perhaps you need something like:
> "c:\Program Files\This is where p lives\p all a.gps a.txt"
>
> which assumes of course that a.gps and a.txt both live in the pwd, otherwise they should be:
> c:\This is where the files live\a.gps
> and
> c:\This is where the files live\a.txt
 
Thanks its working.

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

rssFeed for this Thread

Contact us