Hexagon Geospatial
MENU

ERDAS IMAGINE Q&A

ERDAS IMAGINE, the world’s leading geospatial data authoring system, supplies tools for all your Remote Sensing and Photogrammetry needs.
Showing results for 
Search instead for 
Do you mean 

How to use DOS command/Batch in Imagine command line and EML

by Technical Evangelist on ‎10-02-2015 12:30 PM - edited on ‎03-24-2016 12:19 PM by Anonymous (542 Views)

How to use DOS command in Erdas Imagine (windows version) command line?

 

Erdas Imagine Command line fully support DOS command.

Here is some examples:

 

Del:

Dos command: >del c:\test\dd.txt

 

Imagine Command:

system cmd “/c” del quote(“c:\\test\\dd.txt”) 

 

copy:

Dos command: >copy c:\test\dd.txt d:\work

 

Imagine Command:

system cmd “/c” copy quote(“c:\\test\\dd.txt”)  quote(“d:\\work”)

 

 

Note:

“/c” : will append argument to cmd

You have to use quote() and \\ for your path.

 

 

Use DOS command in EML?

 

It is same as Imagine command line.

for example:

 

component test{

frame test

{

       title "test";

      

       button m1btn;

       button closebtn;

      

       group test

       {

              geometry 0,0,200,100;

              button m1btn

              {

                     title above center "test1";

                     on mousedown

                     {

                           system cmd "/c" copy quote("c:\\test\\dd.txt")  quote("d:\\work");

                     }                   

              }

             

              button closebtn

              {

                     title "close";

                     below m1btn;

                     on mousedown

                     {

                           unload;

                     }

              }

       } # End of "group test"

      

} # End of "frame test"

on startup

{

       display test;

}

} # End of "component test"

 

 

Use DOS batch in Imagine command line or EML?

 

It is very easy to do:

For example, you have a DOS batch file called c:\test.bat

 

#This is comment

copy c:\dd.txt d:

 

In your Imagine command line, you can call this batch file:

job “c:/test.bat”   #use unix path style

 

Same as EML

              button m1btn

              {

                     title above center "test1";

                     on mousedown

                     {

                           job “c:/test.bat”  #use unix path style

                     }                   

              }

 

Contributors