Cannot call 2 batch files .. executes only one batch and the program exists

Hello,
I am trying to call 2 batch files from the program . due to some reason only first batch file is called and second one is not called . any idea why it is happening.
import java.util.Properties;
import javax.mail.*;
import javax.mail.internet.*;
import java.io.*;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
public class MyBatchFiles {
      public static void main (String args[]) throws Exception {
    StringBuffer output  = new StringBuffer();
    StringBuffer error = new StringBuffer();
    try {
               //call batch files
               Process Process=Runtime.getRuntime().exec("cmd /c start F:\\batch1.bat"); // Batch File Path
                   Process.waitFor();
                  BufferedReader inputStreamReader  = new BufferedReader(new InputStreamReader(cubeBuildProcess.getInputStream()));
               BufferedReader errStreamReader  = new BufferedReader(new InputStreamReader(cubeBuildProcess.getErrorStream()));
               output = new StringBuffer();
               error = new StringBuffer();
               for(String ProcessLine;(ProcessLine=inputStreamReader.readLine())!=null;)
                         output.append(ProcessLine);
               for(String ProcessLine;(ProcessLine=errStreamReader.readLine())!=null;)
                         error.append(ProcessLine);
               System.out.println("transformer output = " + output);
               System.out.println("transformer error = " + error);
               if (error!=null){
                         //calling batch2
                         Process Process2=Runtime.getRuntime().exec("cmd /c start F:\\batch2.bat"); // Batch File Path
                         Process2.waitFor();
                         BufferedReader Process_inputStreamReader  = new BufferedReader(new InputStreamReader(Process2.getInputStream()));
                         BufferedReader Process_errStreamReader  = new BufferedReader(new InputStreamReader(Process2.getErrorStream()));
                         for(String ProcessLine1;(ProcessLine1=Process_inputStreamReader.readLine())!=null;)
                                   output.append(ProcessLine1);
                         for(String ProcessLine1;(ProcessLine1=Process_errStreamReader.readLine())!=null;)
                                   error.append(cubeCopyProcessLine);
       }catch(Exception e) {
              e.printStackTrace();
}Thanks
Mike

It's your if statement. Why do you think it could be happening?

Similar Messages

  • I was trying to update the i pad and then suddenly it is not recognized by my computer only one line and the apple

    my i pad turn off while i was trying to update the software and i am unable to rest the setup again ?
    it is not recognize by the computer

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try on another computer
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar       

  • Only one user at the time can execute VE01 (due to blockage of VEIAV)

    Hi,
    As I understand it only one user at the time can execute VE01 (or MEIS for arrivals). If someone is already executing the VE01 transaction the error-message "Table VEIAV is blocked by user XX" appears. It does not matter if one tries to execute it for different legal entities - no parallel processing seems to be possible.
    This is a huge limitation for a global concern with many entities operating in the same SAP instance. Does anyone recognize this problem and are there any ways to get around it? It does not make sense that dispatches (VE01) and arrivals (MEIS) cannot be executed for several organizational units at the same time in parallel?
    Thanks in advance,
    Mats Hansson

    yes I know this problem.
    One should not maintain much thru this transaction.
    for me it is not more than an emergency transaction, as it is not really more than table maintenance thru SM30
    You should investigate what entries/changes the users have to make.
    Limit these manual entries by having better data in the system, so that SAP can itself create the entries for this table.
    Organize more, less users , maybe just one per company who shall maintain VEFU manually.
    Train them to prepare their entries before they start using VEFU.
    Explain that they should leave VEFU as soon as possible as the block other users.
    assign maintenance windows to the users.

  • I am trying to now install a free trial of indesign because despite paying $50+ a month for this supposed service I cannot open an indesign file I've been sent and need to do work on it urgently. I have now signed in again for a free one month trial and i

    i am trying to now install a free trial of indesign because despite paying $50+ a month for this supposed service I cannot open an indesign file I've been sent and need to do work on it urgently. I have now signed in again for a free one month trial and it claims to be downloading but this is not happening at all. I am on a Macbook Air and Abobe for my $600 a year membership you have totally ruined by Friday night. If there's a human being out there at Abode please respond now

    Hi,
    If you have already subscribed to the membership, please follow the help document below:
    https://helpx.adobe.com/creative-suite/kb/trial--1-launch.html
    Regards,
    Sheena

  • How to open multiple sql files in only one ssms instance

    how to open multiple sql files in only one ssms instance, I can't get anything to work that I find online..I hope you can help us.

    I tried opening two files but selecting and hitting enter. it opens one SSMS and two tabs.
    Balmukund Lakhani
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog |
    Team Blog | @Twitter
    | Facebook
    Author: SQL Server 2012 AlwaysOn -
    Paperback, Kindle

  • IPhone plays only one playlist and won't others

    Hi guys,
    can anyone help me; I have my iPhone for so long time, always updated with latest version of software, but recently after latest update 3.1.3. iPod plays only one playlist and won't play any other. Also can't enter any other artist file or videos. When I try to, Ipod closes! The rest of phone works fine.
    Could it be problem with latest update? How can I reset latest update?
    Thanks!

    The latest update works fine for most people, but your's might not have been applied correctly for some reason.
    Try the standard troubleshooting steps in order:
    Restart your phone: Press and hold the Sleep/Wake button for a few seconds until a red slider appears, and then drag the slider. Then press and hold the Sleep/Wake button until the Apple logo appears.
    Reset your phone: Press and hold both the Sleep/Wake button and the Home button for at least ten seconds, until the Apple logo appears.
    Restore your phone: Restore: http://support.apple.com/kb/HT1414
    Make an appointment to have an Apple Retail Store Genius look at your phone. http://www.apple.com/retail/geniusbar/
    If you're in the US, call U.S. iPhone technical support: 1-800-MY-IPHONE (1-800-694-7466)
    If somewhere else, find the contact number here: http://www.apple.com/support/contact/phone_contacts.html

  • Need to use only one sender and receiver communication channel.

    Hello Experts.
    I have a scenario where in I have to use only one sender and receiver communication channel to push files from different source directories to different receiver directories.
    For Eg;
    Sender                              
    D://dir1/file1 --->                  E://dir1/File1
    F://dir2/file2 ---->                 G://dir2/file2
    H://dir3/file3----->                 I://dir3/file3.
    Can this be achieved by using pass through scenario?
    Please let me know if the requirement is not clear.     
    Thanks in advance.
    Advit Ramesh

    Hi Advit,
    I think it is possible. You have to use the Advanced Selection for Source file in the sender channel to define multiple files to be picked up. Also, the Dynamic configuration must also be enabled and used in the mapping so you can manipulate the target directory and target file name based on your source files.
    For Polling from multiple directories:
    http://wiki.scn.sap.com/wiki/display/XI/File+Sender+Adapter+-+Polling+Multiple+Directories
    Dynamic Configuration:
    Dynamic file name and directory in Receiver File Adapter - summary of possibilities - Process Integration - SCN Wiki

  • I can see only one ringtone in the custom ringtone box.plz help

    i can see only one ringtone in the custom ringtone box.plz help

    Cap,
    This view, with the one photo big and the thumbnail strip across the top, is what happens when you double-click a photo with "Edit in: Main Window" set in the Preferences. There should be a button visible that says either Done or Return, to exit edit mode and return you to the library. If you still see only one photo, use the size slider in the lower right corner to reduce the photo size and get more thumbnails on the page.
    If, for some reason, you can't exit the edit mode, you may have a corrupt preference file. Quit iPhoto. Use the Finder to navigate to Macintosh HD/ Users/ (your user name)/ Library/ Preferences/ com.apple.iPhoto.plist and move that file to the Trash. Launch iPhoto, and you should be returned to the main viewing mode. You'll have to go in the Preferences and reset them to your liking.
    Regards.

  • Why can i see only one picture in the illustration windows with iTunes 10.5.1?

    why can i see only one picture in the illustration windows since iTunes 10.5.1?

    Assuming Apple doesn't eviscerate the files of the secondary graphics with another upgrade, there could be a plug in that reads the graphic and runs along side iTunes..we should get someone or Apple to program an alternative If we have to accept this downgrade in iTunes proper.
    I've developed a quick workaround, and am still hoping Apple will fix this!
    Go To Get Info on the tune you want to see secondary artwork for.
    Go To the Artwork tab
    Drag the back cover to the desktop, and it will create a new jpg you can open with quick viw or prieview where you can see it large!
    you end up with a lot of jpgs on the desktop to discard!

  • TS3276 I created 2 Gmail addresses. My Mac recognizes and accept only one name in the System Preferences

    I created 2 Gmail addresses. My Mac recognizes and accept only one name in the System Preferences.
    When I send a mail with one of the address, the recipient receives it with this address, however, if he replies, the incoming address will be the second one? ? ?

    I've never had a problem with multiple email addresses. My ISP's email account has multiple accounts and the same SMTP server, no problem.
    I can't speak for GMail as I only have one, and that is my spam email account, so I don't really care what it sends.
    I really don't understand your response.
    What was "reviewed" and what was "ok" about it?
    Their suggestion was to open a different session for each Gmail account.
    "Different session." What does that mean?
    Gmail is a very bizarre email server. It was designed to be web-based, but due to demand, they made it pseudo-compatible with POP and IMAP.
    If you move email out of the Inbox, Mail will reply using the "default" email account, not necessarily the one that was originally associated with the message. Being that Gmail doesn't really have mailboxes or folders, but has tags it calls "Labels," it may have something to do with that issue.

  • Why can´t I Export my H264 file as a VMW file in quick time 7. The program only does 30 seconds?.

    Why can´t I Export my H264 file as a VMW file in Quick time 7pro. The program only does 30 seconds of the file?

    Why can´t I Export my H264 file as a VMW file in Quick time 7pro. The program only does 30 seconds of the file?
    The Windows Media codec you are using is running in the "demo" mode. To export full clips you must purchase or upgrade to one of the export capable codec components like those included in the "Studio" or "Studio Pro HD" software package.

  • On my 90 day old MacBook Pro I can't send or receive (Mobile Me) email via "Mail."  The fetch icon keeps spinning.  Any help would be greatly appreciated.  I'm only one day past the free Apple care.  Thanks!

    On my 90 day old MacBook Pro I can't send or receive (Mobile Me) email via "Mail."  The fetch icon keeps spinning.  Any help would be greatly appreciated.  I'm able to receive Mobile Me emails on my iphone or via the web, but just not on the laptop.  I'm only one day past the free Apple care:(
    Thanks!

    glippert wrote:
    Tkx, tjk...I tried calling Apple Care and they directed me to the forums... 
    I guess that's their right at one second past midnight on the 91st day.
    Here's the link to the MobileMe support forums; I'd post there:
    https://discussions.apple.com/community/mobileme

  • My PC won't start with only one push of the start button.

    hi guys my pc won't start with only one push of the start button. It takes me 1 to 10 pushes for it to start. I encountered this main bios error once when my pc started but it fixed on its own. What could be the problem?

    Hi
    The problem can be fixed by running a latest BIOS Update on your unit or if it is a mechanical issue it could be the power button itself.. you can call HP tech support if the notebook is still in warranty.. they'll be able to help you.
    Hope this helps.
    ***** Click the KUDOS Thumbs UP (Like) on the left to say 'Thanks'*****
    ****Make it easier for other people to find solutions, by marking my answer “Accept as Solution”&"Kudos"if it solves your problem.****
    -VJ
    Although I am an HP Employee, I am speaking for myself and not for HP.

  • I have recently updated my CC programs to the latest version and now all of my files wont open by default into their respective programs, only if I open the program and go to file open and open the file from there. How can I fix this?

    I have recently updated my CC programs to the latest version (CC2014) and now all of my files wont open by default into their respective programs, only if I open the program and go to file>open and open the file from there. How can I fix this?
    I have tried 'Open with' and the version of the program now installed on my computer isn't even suggested as an option and when I browse for it, the file wont open with it anyway

    On Windows (don't know about Mac), the latest version will always take over the file association, and become the default for indd files. It's impossible to change it.
    But there is a plugin for ID that makes this possible. Never tried it myself.
    https://www.rorohiko.com/wordpress/downloads/lightning-brain-soxy/

  • I get an error message saying "The iTunes Library.itl file cannot be found or created" when I try to open iTunes on my computer and the program fails to open.   How can I fix this?

    When I try ot open iTunes on my computer I get an error message stating "The iTunes Library.itl file cannot be found or created" and the program fails to open.  How can I fix this issue?

    Hi pgarard1,
    If you are having issues with launching iTunes after an update, you may want to take a look at the troubleshooting in the following article:
    iTunes for Windows: Doesn't open after upgrading in Windows Vista or Windows 7
    http://support.apple.com/kb/TS2363
    Regards,
    - Brenden

Maybe you are looking for

  • Tungsten t3 will not sync with Windows 7 64 bit using cradle sync

    Tungsten t3 will not sync with Windows 7 64 bit using cradle sync any suggestions?

  • PDF won't print in Preview but OK with Adobe Reader

    Periodically (and rarely) I run into a problem where an application yields a PDF for printing, is submitted to the print queue of my Laserwriter 16/600 PS, and instead of printing, the following message pops up briefly before the job is wiped out: th

  • "default interface" equivalent for SG300/500 switches?

    Can anyone tell me if there is an equivalent CLI command to reset an interface configuration to default? In IOS it is "default interface <interface>" which removes all configuration from that switch port. I don't seem to be able to find the same in t

  • NAFTA

    Hi All, I am working on Oralce 11i, and building report for Certificate of Origin, i am facing problems in that any body have that report or SQL Query please email me or post here. Thanks, [email protected]

  • Degauss DLT?

    I am getting lots of errors on a DLT tape that I had degaussed. I was able to write to it using NetBackup but it failed in verify. Every time I try to access this tape now, it gives these errors and cleans itself regardless of which drive I use. Shou