Executing Batch file from Remote machine

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AbhishekTecnics
    New Member
    • Apr 2014
    • 1

    Executing Batch file from Remote machine

    Hi All,

    I wrote code for executing batch file using java.but its not working..

    Code:
    package batchapp;
    
    import java.io.IOException;
    
    /**
    *
    * @author mahapatra.a
    */
    public class BatchApp {
    
    /**
    * @param args the command line arguments
    */
    public static void main(String[] args) throws IOException, InterruptedException {
    // TODO code application logic here
    
    
    
    Process p = Runtime.getRuntime().exec("\\\\192.168.1.xxx\\D\\D eleteME\\run.bat");
    p.waitFor();
    
    System.out.println("deleted...");
    
    }
    }
    Its Urgent..please. .:)

    please Help me out..
    Last edited by Rabbit; Apr 14 '14, 05:48 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    By, simply stating that your code "doesn't work," along with code that appears to have had very little if any troubleshooting performed, and expecting someone to help doesn't usually result in much of an answer and may result in your thread being deleted.

    Instead, please tell us what you were expecting to happen, what actually happened, for each error: the EXACT title, error number, and descriptions that occurred and at what line in your posted code the error occurred. These are the minimum requirements for posting a question of this nature.

    BTW: Please don't report your threads in order to get attention. (~_~)

    Comment

    Working...