Execute MS-DOS command in Transaction

Hello,
I am copying encrypted files from the ftp server with the action: FTP Input.
This works fine, but after this action i want that it executes a dos command from xMII to decrypt the files. I have a statement like this:
raes-1.exe -d %TEST% DELFOR_20080507095802864.aes DELFOR_20080507095802864.xml
I already tried some things, but i do not use a htm page or javascript. I want only the functions in a transaction and schedule this transaction. It has to look every day if their are files. Copy and decrypt them.
When i executed through windows --> start --> run it works, so somehow it should also be possible to execute the command through MII.
Kind regards,
Nick
Edited by: N. Meuter on Oct 17, 2008 3:38 PM

I have developed it on my own system and uploaded it through the xmii menu custom action blocks.
Now i deleted the action block and wanted to upload it again. But it did deployed directly. Where should i clear java? On my own computer or server?
My java console on local machine says this:
JNLP JREDesc in Component ignored: null
JNLP JREDesc in Component ignored: null
JNLP JREDesc in Component ignored: null
ConsoleLogger::Creating NEW instance...
WARN - Could Not Load Muffins, Using Defaults: http://smnlxmii2:50000/XMII/CMSLogicEditor/LookAndFeel
<<< frog.jar: version 5.4.6  02/01/06  sap.theme: Tradeshow >>>
Unable to localize label 'null', null
Unable to localize label 'null', null

Similar Messages

  • Execute a dos command

    I am trying to execute a dos command thru sap and specific the delete command.
    i tried in 2 ways (i read it to the forum) but i can't do it.
    a)            DATA : FILE(100),
                   PARAM(50),
                   COMM(30).
                   COMM = 'DEL.COM'.
                   CONCATENATE 'C:\' 'A.TXT' INTO FILE.
                   CALL FUNCTION 'GUI_RUN'
                   EXPORTING
                   COMMAND   = COMM
                   PARAMETER = FILE.
    b)  CALL METHOD cl_gui_frontend_services=>execute
      EXPORTING
       DOCUMENT               = 'C:\A.TXT'
        application            = 'YDEL'
        parameter              = 'C:\A.TXT'
       DEFAULT_DIRECTORY      =
        MAXIMIZED              =  'X'
       MINIMIZED              =
       SYNCHRONOUS            =
        OPERATION              = 'OPEN'
      EXCEPTIONS
        cntl_error             = 1
        error_no_gui           = 2
        bad_parameter          = 3
        file_not_found         = 4
        path_not_found         = 5
        file_extension_unknown = 6
        error_execute_failed   = 7
        synchronous_failed     = 8
        not_supported_by_gui   = 9
        OTHERS                 = 10.
    Please help me ...

    Hi dimath,
    1. sorry, now this will work.
       (this will not even open the dos window)
      (it will get opened only for a fraction of seconds, and then get closed automatically)
      the file will get deleted.
    2.
    command = CMD
    parameter = /C DEL D:\AA.TXT
    (note /C is important)
    regards,
    amit m.

  • Execute a DOS command in java

    Hi all,
    Is it possible to execute a DOS command in java? If so, how do I do that?
    Also, if it is a Linux machine, may I execute a Linux command in java?
    Thanks for your help.
    Regards,
    Bernard

    First, define 'command'.
    You can run external programs with Runtime.exec (eg. Runtime.getRuntime().exec("notepad");) but there are a few drawbacks regarding that method.
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Executing a DOS Command from JSP

    How do i execute a Dos command from within JSP. I would like to execute a sql Loader command .
    Thanks

    You use Runtime.execute().
    Take a look here for a few of the tricks involved in it:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Executing a dos command from java in windows nt

    i need to execute the
    " net send"
    command from the command line in windows nt, from within my java program... is there any way that i can execute cmommands in the dos command shell? or rather, does anybody know a way i can send a message ( in windows ) from java, from one computer to another over the lan?? I cannot have a java programming running on all the other computers, so i cannot make my program serve, it must just send the messges using a lan command....
    (the net send command just sends a message in the form of a pop up box on the receiver's screeen)
    thanks a bunch guys!!!
    Thanks a bunch guys!!!!

    you can do that with exec() in Runtime.
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec(command here);but before you do that you need to read this:
    http://www.javaworld.com/jw-12-2000/jw-1229-traps.html
    hth
    partha

  • How to execute dir dos command in Runtime Execution

    Hi All,
    Does anybody know how to execute the dir command in DOS in the runtime execution
    for example,
    when we open the command prompt,
    c:\Documents and Settings\java> e:
    e:\cd java
    e:\dir *.*
    how we can list the directory in runtime execution?

    Process childProcess = Runtime.getRuntime().exec("cmd /C dir *.*");or try with
    ProcessBuilder pb = new ProcessBuilder("cmd /C dir *.*");
    Process childProcess = pb.start();
    NOTE: We can use the ProcessBuilder class from J2SE 5.0+.
    for further reference check the below link
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html?page=3
    and don't forget to go through API documentation for java.lang package
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/package-summary.html
    and if you want to implement it through Java which provides you a list of Files & directories in the present directory here is an example of such code snippet REF:as insisted by my fellow poster.
    File file = new File("<present_directory_path>");
    if(file.isDirectory()){
       String fileNames[] = file.list();
            for(String fileName:fileNames)
               System.out.println(fileName);
      fileNames = null;
            or for detailed info use
             File files[] = file.listFiles();
             for(File fileEntity:files)
                System.out.println("FILENAME:"+fileEntity.getName+",IS FOLDER:"+fileEntity.isFolder()+",ABSOLUTE PATH:"+fileEntity.toString()+"FILE SIZE:"+fileEntity.length());
             files = null;
    }and please do not forget to go through File API Documentation provided as recommended by my fellow poster.
    hope this might help :)
    REGARDS,
    RaHuL

  • How to execute MS DOS command through Java program???

    Dear Sir,
    I want to run a MS-DOS command through my Java program. I have tried "Dir" command but no other command which takes command line args doesn't work at all. Please help.
    import java.io.*;
    class CommandPrompt
         public static void main(String[] args)
              try
                   File file = new File("C:/Temp/Java");
                   String[] cmd = {"command.com","/c","md folder"};
                   String[] envp = {""};
                   Process m;
                   String s = "";
                   m = Runtime.getRuntime().exec(cmd,null,file);
                   BufferedReader buf = new BufferedReader(new InputStreamReader(m.getInputStream()));
                   while ((s = buf.readLine())!=null)
                        System.out.println(s);
              catch (Exception ex)
                   System.out.println("Exception is "+ex);
                   ex.printStackTrace();

    1. This forum is for Swing-related issues only. This question should be posted to the "Java Programming" forum.
    2. Please enclose your sample code in code blocks; it's much easier to read that way. See here for how it's done: http://forum.java.sun.com/faq.jsp#messageformat
    3. Please provide more information, like what error messages you got and what OS you're running. For instance, if you're running WinXP, Win2k or NT4, your command processor should be "cmd.exe", not "command.com". When I made that change, your program worked for me.

  • How can I execute a dos command?

    I tryed so:
    import java.io.BufferedReader;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.PrintStream;
    public class Builder {
         public static void main(String[]args)
                   //makeFile();
                   execute();
         * @author Savio
         * @description Esegue comando dos
         * @throws IOException
         public static void execute()
              try
                   Runtime will = Runtime.getRuntime();
                   Process pid=will.exec("cmd /c c:prova.bat");
                   InputStreamReader isr = // step 3
                        new InputStreamReader( pid.getInputStream() );
                        BufferedReader br = new BufferedReader( // step 4.
                        isr );
                        String line;
                        while ((line = br.readLine()) != null)
                        System.out.println(line);
              catch (IOException e)
                             e.printStackTrace();
         * @author Savio
         * @description Crea e scrive un file
         * @throws IOException
         public static void makeFile() throws IOException
              FileOutputStream file=new FileOutputStream("c:/condor/bin/file.submit");
              PrintStream out=new PrintStream(file);
              out.println("### SUBMIT DESCRIPTION FILE ###");
              out.println("Universe = java");
              out.println("Executable = job.class");
              out.println("Jar_files = job.jar");
              //out.println("Arguments = "+args[0]+" "+args[1]+" "+args[2]+" "+args[3]);
              for (int i=0; i<10;i++)
                   out.println("Output"+i+"txt");
                   out.println("Error"+i+".txt");
                   out.println("Log"+i+".log");
    This doesn't works!!
    But, if I execute my .bat from dos it works... what's the problem?
    Can you help me!!!
    I'm angry! :)

    Please use code tags when posting code.
    Use ProcessBuilder or Runtime.exec(String, String[])

  • Executing a dos command from java

    Hi guys.
    This line works fine:
    process = Runtime.getRuntime().exec("command.com /C c:\\test.bat");
    But this line do nothing:
    process = Runtime.getRuntime().exec("command.com /C c:\\test\\test.bat");
    I need to run a dos file in some directory in my HD. It works fine in root, but do nothing when I change to directory. I do this from an applet.
    Any ideas/suggestions?

    Any ideas/suggestions?The file isn't actually there (it isn't in the directory.)
    There is a permisions problem (which is unusual but not impossible on windows.)
    The script itself is failing - you didn't indicate "how" it doesn't work so this is possible.

  • Problems to execute "cd" DOS command from Java program

    Anyone try to exec command "cd.." or "cd directory", it doesn't have any action. No exceptions, just don't do anything.
    Runtime.getRuntime().exec("cd\\");
    Runtime.getRuntime().exec("cd hello");
    However, when I try the following, it is working fine. Any ideas???
    Runtime.getRuntime().exec("explorer");
    Runtime.getRuntime().exec("javac Test1.java");

    That's because cd is built into the command
    interpreter in Windows. Runtime.getRuntime().exec()
    can only be used to launch external programs. This
    article should get you going:And that's not the only reason why you can't do this.
    When you do
    Runtime.getRuntime().exec("cd c:\\");
    (or, heck, "cmd /c cd c:\\"): the new command that you spawn will cd to the destination specified, and then exit. The parent process (your java program, that is launching this command) won't go anywhere - the "cd" doesn't affect it.
    The only way to change your OS directory in Java is to invoke native code. And even then, the effects are undefined (in terms of how your CLASSPATH will be affected, etc.).

  • Execute DOS command in current window!

    All:
    Here is my code :
    import java.io.*;
    public class BuildScript {
    public static void main ( String[] args ) {
    String[] command = {"C:\\winnt\\system32\\cmd.exe", "cls"};
    try {
    Process process = Runtime.getRuntime().exec ( command );
    process.waitFor();
    } catch ( InterruptedException e ) {
    e.printStackTrace();
    System.exit(-1);
    } catch ( IOException e ) {
    e.printStackTrace();
    System.exit(-1);
    System.out.println ( "DONE!" );
    I just want to exeute some simple DOS command from Java application. And then I run this code, it hangs there for ever. I comments out "process.waitFor()", then it print out the "DONE" however it seems that it just open another console and clear that one and exit. For the main console I start my code, nothing happened.
    Can anyone help me out how to execute the dos command in current console window.
    Thanks

    Can anyone help me out how to execute the dos command in current console window.Sorry to say but there is no way to do that.
    The best way to clear the screen is to print a few hundred newlines.
    Trust me, this is a frequently asked question.

  • How to execute DOS command in Java?

    I want to execute a dos command in Java,such as execute test.bat command? How to realize it?
    Thanks in advance!

    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    I found this article really useful in solving this. Hope it helps.
    Cheers,
    John

  • Execute DOS command inside java

    I have a java program that reads each new user from an inputfile and writes that same user to an output file. The program works fine and is shown below:
    import java.io.*;
    public class FileStreamsTest {
    public static void main(String[] args) {
    try {
    File inputFile = new File("newbousrs.txt");
    File outputFile = new File("outagain.txt");
    FileInputStream fis = new FileInputStream(inputFile);
    FileOutputStream fos = new FileOutputStream(outputFile);
    int c;
    while ((c = fis.read()) != -1) {
    fos.write(c);
    fis.close();
    fos.close();
    } catch (FileNotFoundException e) {
    System.err.println("FileStreamsTest: " + e);
    } catch (IOException e) {
    System.err.println("FileStreamsTest: " + e);
    What I would like to do after each write is to execute a DOS command that looks something like this: supervsr.exe -USER username -PASS password -IMPORTUSERS importfile.txt
    The DOS command above will add each user to the system I want to as the loop goes through each user record.
    How do I execute the DOS command above inside java?

    Tried what but still having a problem...here is my code:
    import java.io.*;
    public class ReadSource {
    public static void main(String[] arguments) {
    try {
    FileReader file = new FileReader("newbousrs.txt");
                                  //FileWriter letters = new FileWriter("outagain.txt");
                                  //PrintWriter pw = new PrintWriter(new FileWriter("outagain.txt"));
    BufferedReader buff = new BufferedReader(file);
                                  Runtime rt = Runtime.getRuntime();
    boolean eof = false;
    while (!eof) {
    String line = buff.readLine();
    if (line == null)
    eof = true;
    else
    System.out.println(line);
                                                 Process proc = rt.exec("\\Blowfish\\droot\\Program Files\\Business Objects\\BusinessObjects 5.0\\supervsr.exe -USER xxxxx -PASS yyyy -IMPORTUSERS \\Blowfish\\droot\\accsp\\public\\newusers\\newbousrs.txt");
                                                 //System.out.println(line.substring(4, 10));
                                                 //System.out.println(line.substring(3,line.indexOf(',',3)));
    buff.close();
    } catch (IOException e) {
    System.out.println("Error -- " + e.toString());
    There error I get is this:
    C:\jakarta-tomcat-4.0.3\webapps\webdav\WEB-INF\classes\accsp>java ReadSource
    NU,Public,Steve Mcnealy,Steve Mcnealy,U,N,N,Y,N,N,PC,F,Y,N,N
    Error -- java.io.IOException: CreateProcess: \Blowfish\droot\Program Files\Busin
    ess Objects\BusinessObjects 5.0\supervsr.exe -USER accsp -PASS fish -IMPORTUSERS
    \Blowfish\droot\accsp\public\newusers\newbousrs.txt error=3

  • Execute DOS command from java application

    Hello,
    I want to execute a DOS command (MOVE, in order to move an image from a folder to an other) from a java application. How can I do this?
    Francesco

    Yes I have tested it and it is working but only when executing a bacth file. For instance:
    Runtime rt = Runtime.getRuntime();
    try{
         Process proc = rt.exec("move.bat");
    }catch(Exception ex){
         ex.printStackTrace();
    }and the command in move.bat is:
    move c:\\temp\\*.gif C:\\temp2
    You don't have to use double slashes in batch files, only in Java. But anyway it is working both ways.
    It is not working when you try to execute the command without the batch file:
    Process proc = rt.exec("move c:\\temp\\*.gif C:\\temp2"); -> this will not work.
    It should work. Try to execute another command to see what happens.

  • Error while running DOS command in Java

    Hi all,
    I use "runtime" class to execute a DOS command "copy C:\\pathname\\*.* C:\\backupPathname\\". But I saw an error msg "CreateProcess: copy C:\pathname\*.* C:\backupPathname\ error=2".
    I did create a folder C:\backupPathname\ before running the DOS command.
    Pls help me all Java genius.

    I ended up writing a small 'c' program and pasing the command in to it from java. The problem seems to be that in dos, unlike unix, the copy command is not a program, rather the command is interpreted by the command.com program.

Maybe you are looking for

  • How do I Update Photoshop CS for Mac OS 10.9?

    I'd like to continue to use my old Photoshop CS (circa 2003) on my Macbook Pro (mid 2009).  I just upgraded to OS 10.9.2.  Now, trying to open Photoshop brings up this error message: You can't open the application "Adobe Photoshop CS" because PowerPC

  • XMLType payload fails with oci8 driver  when doing getStringVal

    I have a queue with an XMLType payload (I'm using 9.2). When I try to do a getStringVal() or getClobVal() on the dequeued XMLTYpe payload it works fine with the thin driver but when I switch to oci8 I get the following - ORA-21608: duration is invali

  • Need to update my iphone 4 operation system

    Bought my iphone 4 in sept 2011...have not updated my operating system since then...I need to find out how to do that...

  • Cannot boot OS X 10.4 from External Drive

    I have an external LaCie drive that has three partitions. I have 10.2.8 on one of the partitions, and I just installed 10.4 on another of the partitions. I am trying to boot from the partition with 10.4 on it, so I hold down "option" when the compute

  • Alternatives for importing video with two audio paths.

    So, I been on the Mirillis Action!(Screen Recorder) Forums and, have not found the solution. The problem is when I import the file it says its not supported. Like you see there, so the video specs are .avi files with 2 audio paths.(Action! recorder h