Exe running from java fails to get user input .Help me...

I have an DOS based exe.It just asks for input for a number from the user and prints the number it gtes.
When I try to execute this program from Java with the following code
import java.lang.Runtime;
import java.lang.Process;
import java.io.*;
public class runtimetest     {
     public static void main(String[] args)     throws Exception {
          Runtime rt = Runtime.getRuntime();
          Process p = rt.exec("myExe");
nothing happens.Thatis It doesnot ask for the input .and I am just unable to know whether its running or not.
What could be wrong?
What is the other means to tun the DOS based exe that accepts user inputs , from Java.
Plz help me as I am in urgent need.
Aathi

try this
Runtime r = Runtime.getRuntime();
          Process p = null;
          try
               System.out.println("Exe will be called");
               p = r.exec("cmd.exe /c start c:/ur exe path ");
               p.waitFor();
          catch (Exception e)
               e.printStackTrace();
          }

Similar Messages

  • Process (.exe) run from java

    Hi all,
      I need to run a ".exe" from my .java file. I have developed a sample Swing GUI application that calls a ".exe" from my program. The application contains a dialog box. The dialog contains a text box and a button. When user will enter some number in the text box and hits the button a ".exe" will be called. That ".exe" in turn will perform a DB activity, fire some sql queries and insert some data into the database. The 32 bit ".exe" is built in Visual studio and developed by C++.
    The problem is that when I am entering some number and pressing the button, the ".exe" file is invoked and the process starts running, but I could not be able to see the data that is inserted into the database after the tested time of process run. I could see the data in table only when I quit my java swing application by closing the dialog.
    What I mean by tested time of process run is that, I have tested the ".exe" separately by running the same from a batch file. That is running fine and data is inserted into database like a charm. I want the same from java code.
    Programmatically what I did to run the .exe is as follows:
    String[] cmdArray = new String[3];
    cmdArray[0] = "testRun.exe";
    cmdArray[1] = "some args";
    cmdArray[2] = "some args";
    Process process = Runtime.getRuntime().exec(cmdArray,null);
    It will be of great help if anybody can figure out where the actual problem is.
    My program is not even multithreaded. The whole thing is written inside the main thread itself as in normal case.
    Thanks in Advance.....

    {quote}
    The problem is that when I am entering some number and pressing the button, the ".exe" file is invoked and the process starts running, but I could not be able to see the data that is inserted into the database after the tested time of process run. I could see the data in table only when I quit my java swing application by closing the dialog.
    {quote}
    The process must issue a COMMIT before the data will be visible to ANY other session.

  • Analytical Services failed to get user's parent group tree with Error

    Hi,
    We have a frequent errror during our weekly batch for an application.
    The context:
    - Essbase Administration Services we are using is version is 9.3.1.
    - 8 applications are calculated during the week-end. The scripts executed are exactly the same for the 8 applications.
    - For example let's say that 5 scripts are launched during the night in the batch for each application (script 1, script 2 ... script 5)
    - App1 and App2 are launched alone and before the 6 others applications as these applications database are 3 x bigger (App1 is calculated alone, then app2 is calculated alone, then app3 to app8 scripts are launched in the same time).
    The issue :
    - We don't see any issue for app3 to app8, the calculation are executed without any problem from script1 to script5.
    - But we have an error in App1 and App2 log when the bath execute script 4 and we see the following error in the server log **
    "Analytical Services failed to get user's parent group tree with Error".
    (** : we don't see any log for script 4 in the application log - it's like the server bypass script 4 to go directly from script 3 to script 5 )
    Nothing special is done in script 4 but just an aggregation of the Year dimension (using a @SUM(@RELATIVE(Year,0)) calculation.
    I think that there is may be a synchronization error with Shared Services but what is strange is that it's always for the same script 4 and the batch is launched at different time every week-end.
    Can the issue be linked to the size of the database of applications (8 Gb) and difficulties for the processor to executes aggregation in a large database volume ?

    Hi,
    According to your description, my understanding is that the error occurred when sending an email to the user in workflow.
    Did you delete the existing Connections before setting NetBiosDomainNamesEnabled?
    If not, I recommend to delete and recreate your AD connections, then set NetBiosDomainNamesEnabled to true.
    Or you can delete the original User Profile Service Application and create a new one, then set the NetBiosDomainNamesEnabled to true and start the User Profile Service Application
     synchronization.
    More reference:
    http://social.technet.microsoft.com/wiki/contents/articles/18060.sharepoint-20xx-what-if-the-domain-netbios-name-is-different-than-the-fqdn-of-the-domain-with-user-profile.aspx
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Failed to accept user input when run report on Web

    I've testing a report with one input parameter. It's a date with default current date. It is done by using SQL 'select sysdate from dual;' has been added to before form trigger. User is allowed to input any date other than the default sysdate before submitting the report. The report works fine when run in report builder, but it's failed to accepted user input date when called through web browser. The report still uses the current date as SQL parameter rather than user input date.
    Can anyone help me to fix this bug?
    The report is develped by Oracle 9i and is saved and run in .rdf format.

    I created a report with a user defined parameter p_date of DATE type. In the layout model, I created a field with p_date as data source. In the before form trigger, I put
    'select sysdate into :p_date from dual;
    I run the report through rwservlet:
    http://host:port/reports/rwservlet?report=datetest.rdf&destype=cache&desformat=html&userid=scott/tiger@orcl&paramform=yes
    In the html parameter form, I change the date from default current date to a future date and that date is shown in the final report.
    So I can't reproduce the bug.
    One thing you can try it to turn on reports server trace file, see what command line is sent to reports server when you submitting the parameter form.
    Thanks,
    -Shaun

  • Failed to get user type

    We are running GroupWise 7.0.3 hp3 webaccess. When a any user logs into webaccess they get this error. Failed to get user type: response was empty
    If they click OK they can still get in and seems to be functioning correctly. Any ideas what would cause that error. I have been looking at various logs but can not seem to find the correct one.

    I have the same error here, it seems cosmetic.
    In our situation we are using M+Archive WebViewer and we only get the error when we replace the GW802HP2
    /var/opt/novell/tomcat5/webapps/gw/WEB-INF/classes/templates/webacc/css/caption.htt with the MA supplied caption.htt
    I would love to know if you have M+Archive as well as it will give me more information to go on trying to fix it.
    Dave

  • Failed to Get User Preferences

    I have 3 scripts online right now for ongoing projects that I'm trying to work on only Adobe Story just updated and now won't log me in. I keep getting the "Failed to get user preferences" error. I need to update a script tonight for a client, then prep one for a recording session tomorrow. Can I get this resolved a.s.a.p. please! My ID is [email protected]
    Thanks,
    John

    Hi, the problem still exists: last two works don't compare anywhere:(
    thanks
    Date: Fri, 10 May 2013 05:15:03 -0700
    From: [email protected]
    To: [email protected]
    Subject: Failed to get user preferences
        Re: Failed to get user preferences
        created by Sandeep (Story team) in Adobe Story - View the full discussion
    Hi,
    Can you please check the 'deleted' and 'sync issues' folder that shows up in the bottom left of the Story screen. Just click on these folders to see the list of documents. If your file is present in any of them, you can directly recover.
    From deleted folder you can just click on the document's options (a triangle shows up when you hover on the document) and click on the triangle and then restore to a project.
    If its in sync issues folder, you can delete the document (deletion will just move the document to the deleted folder mentioned above) and then go to deleted folder to restore the document.
    If you still face any issue please let us know.
    thanks
    Sandeep
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5308591#5308591
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5308591#5308591
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5308591#5308591. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Adobe Story by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Worflow failed to get user profile for user

    I have a workflow that sends an email to a user.  In the workflow email, one line has the lookup [%User Profiles:Name%], with Return field "As String" of the list item Field "Account Name" with Value "Current Item:Created By".
    This workflow works for everyone, except it Errors when one user creats an item in this list.  The error is "Workflow failed to get user profile for user...  System Account - An error has occurred in Workflow Name"
    and more detailed error found in logs: "AutoStart Workflow: Microsoft.SharePoint.SPException: Recursive workflows are not permitted.     at Microsoft.SharePoint.Workflow.SPWorkflowAutostartEventReceiver.<>c__DisplayClass1.<AutoStartWorkflow>b__0(SPSite
    superUserSite, SPWeb superUserWeb)
    System.InvalidOperationException: Workflow failed to get user profile for user:domainName\username.     at Microsoft.Office.Workflow.Actions.UserProfileHelper.GetProfile(String propertyName, String user)     at Microsoft.Office.Workflow.Actions.ProfileHelperBase.GetProfileString(String
    propertyName, String userOrOrganization)     at Microsoft.Office.Workflow.Actions.GetUserProfileActivity.Execute(ActivityExecutionContext context)     at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity,
    ActivityExecutionContext executionContext)     at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext)     at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime
    workflowCoreRuntime)     at System.Workflow.Runtime.Scheduler.Run()  "
    When I run "get-addomain -identity [FQDN]", I noticed that our DNSRoot has a totally different name than our NetBIOSName, so I followed this article and made sure to set netbiosdomainnamesenabled to TRUE:
    http://meandmysharepoint.blogspot.ca/2012/09/netbiosdomainnamesenabled-and.html
    To give you an idea of our setup, our DNSRoot is "abc.domain.com" and our NetBIOSName is "TESTING"; 2 totally different names.  When I run "get-addomain -identity [FQDN]", the Name field is: "abc" (just the first
    part of the DNSRoot); therefore, when I look up this user's profile in Sharepoint Manage User Profiles, his account shows as "abc\username" when it should be "TESTING\username".
    I did an IISReset, and I ran a Full Profile Sync. But the workflow still Errors for this user.
    Any ideas how to fix this?  Should I delete MySites and User Profile Service application and recreate them?
    Any tips would be appreciated.
    thanks!

    Hi,
    According to your description, my understanding is that the error occurred when sending an email to the user in workflow.
    Did you delete the existing Connections before setting NetBiosDomainNamesEnabled?
    If not, I recommend to delete and recreate your AD connections, then set NetBiosDomainNamesEnabled to true.
    Or you can delete the original User Profile Service Application and create a new one, then set the NetBiosDomainNamesEnabled to true and start the User Profile Service Application
     synchronization.
    More reference:
    http://social.technet.microsoft.com/wiki/contents/articles/18060.sharepoint-20xx-what-if-the-domain-netbios-name-is-different-than-the-fqdn-of-the-domain-with-user-profile.aspx
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • .exe file from java

    Hi all !!!
    Is it possible to run a *.exe file from java.....
    if yes how??
    if no why not??
    regards
    ad

    Yes. It's possible. One of the Runtime.exec() methods are probably what you want:
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html
    You can't instantiate a Runtime object, so you'll need to call it up by:
    Runtime.getRuntime()
    For example, if you want to run the Calculator in Windows, try:
    Runtime.getRuntime().exec("calc");

  • Having the same problem with Adobe Story. Getting a warning that says "Failed to get user preference

    Having the same problem with Adobe Story. Getting a warning that says "Failed to get user preferences, lost the internet connection." Any help would be greatly appreciated. Phone support was useless

    Yes, me, just now! I was thinking it was because I am on a brand new computer and I did something wrong when I put itunes on it. But now I am thinking it is an itunes issue, not mine.

  • How to fix Workflow failed to get user profile for user:

    hi All,
    How to fix Workflow failed to get user profile for user when using Lookup function in sharepoint designer?

    Try to use “As string” instead of “Login Name” for the “Return field as”.
    Regards,
    Jayant
    jayant prabhakar

  • I wants to call .Exe file from Java Programme

    I wants to call .Exe file from Java programme. Please give answer with example. This very urgent. Help me

    hi
    u can use Runtime.exec() method in java.lang package
    to execute exe files
    regards
    pnp

  • After unlock "failed to get usere preferences"

    Hi there,
    After unlocking my session, I always get the failure: "Failed to get user preferences". I have to sign out and sign in again. Any solution to solf this annoying issue.
    Thx,
    Catsten
    Adobe Story Plus Build 1118
    Windows XP SP3

    We looked into it and found out that its a bug. Thanks for raising it. We'll try to fix it in the next release of Story.
    Thanks

  • Problems with getting user input

    Hi All,
    I want to get user input from a command line and i am NOT using a GUI.
    The user can still see their password when they are typing it in.
    Is there anyway to show '******' when they type in their password??
    This is what I have so far..
    public static void getPassword() {
    System.out.print("Enter password-->");
    DataInputStream input = new DataInputStream(System.in);
    try{  
    password = input.readLine();
    catch (IOException e){
    System.out.println("ERROR " + e);
    Any help would be greatly appreciated.
    Thanks
    Kal.

    Kal,
    I'm pretty sure you're going to need some kind of GUI (either a Java window or an HTML page) to get the desired effect. There might be a way to set the echo character in the command line, but I'm not sure.
    - Sheepy

  • How to get user input to keep in array in the form of int[]?

    I really want to know how to get user input to keep in an array. Or if it's impossible, can i use the value in "int" and transfer it to an array?

    What I understand is that you want to set an input from the user in an array of int.
    Here is how it work:
    1. Create a stream and a buffer to get and store the informations entered by the user:
    BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
    2. Set this input in a String:
    String input = stdin.readLine();
    3. Set this string in an int:
    int userInput = Integer.parseInt(input);
    4. Then you can put this int in the array.
    Warning this code throws IOExceptions and NumberFormatException ( when you try to set letters as int ). But you can catch them easily.

  • How to get User input in JTextField?

    How to get User input in JTextField? Can u anyone give me some code samples? thanks

    read the API!!!

Maybe you are looking for

  • HttpUrlCOnnection Problem in Weblogic 8.1

    Hi All, The following exception occurs "Tried all: '1' addresses, but could not connect over HTTP to server: 'quotes' .nasdaq.com', port: '80'" when i run the below mentioned code from a jsp.But if i tried it from a desktop application it fetches the

  • I just installed RH 10 and it doesn't work

    Hello, I apologize for my poor english. I used to run RH 6 and it worked very well for the past 6 years. My compagny purchased RH 10 a few days ago. I installed RH 10 and after running a few seconds, it shuts without any message. Just a nice shutdown

  • Create very big table

    Hi , call_fact table contain about 300 milion tables. exceptions table contain about 150 milion tables. Both tables have an uptodate statistics. The machine have 8 CPUs The statment already run 48 hours. Can one suggest a faster way to do it ? create

  • Runtime.getRuntime().exec in JBuilder 7

    Hello! I want to do that: Process p = Runtime.getRuntime().exec("CntVirRel.exe"); System.out.println("Procesando....."); p.waitFor(); System.out.println("waitfor end"); which seems easy. My problem is that if I put this code in a program using only t

  • How to download an old free version or testversion of dreamweaver c4?

    Hi I would like to test Dreamweaver but my XP window is to old. How do I and where can I get a free download of Dreamweaver c4?