Starting notepad.exe from within Java app?

Is it possible to start notepad.exe from within a java app to display a log file (for instance)?

search the forum for Runtime.getRuntime()

Similar Messages

  • Automatic Creation of ODBC Data Source From Within Java App

    Good Day Good People :)
    I was wondering if it were possible for a java application to automatically set up an ODBC data source for a JDBC connection in a windows environment.
    This is the method I call to initialise a connection to my database:
    public void initialiseLocalConnection ()
    url = "jdbc:odbc:ICUDB";
    try
    Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
    icuCon = DriverManager.getConnection (url);
    catch (Exception e)
    JOptionPane.showMessageDialog (null, "Error Creating Connection to ICU Database!\n" +
    "Please set up an ODBC data source pointing\n" +
    "to the icudb.mdb file located in the data\n" +
    "folder of the ICU directory and call the\n" +
    "connection 'ICUDB'.", "Database Connection Error", JOptionPane.ERROR_MESSAGE);
    Is it possible to create the ODBC data source ICUDB if it does not exist from within my application.
    All information regarding the possibilty and the application of doing this would be greatly appreciated.
    Kind Regards
    Matt

    Thank you.
    During my search I for dsn-less connections I found the soloution:
    url = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=" +
    System.getProperty ("user.dir") + System.getProperty ("file.separator") +
    "data" + System.getProperty ("file.separator") + "icudb.mdb";
    try
    Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
    icuCon = DriverManager.getConnection (url);
    This works.
    Thanks for the replies.
    Matt :)

  • Starting IExporer.exe from java with J9 in an IPAQ

    Hi all,
    I'm trying to run IExplorer.exe from a java program in a IPAQ with j9 cvm.
    I did try it in Windows 2000 and it works fine but when running it in the IPAQ with Windows CE it throws an exception.
    Looks like the Exception is thrown because it can not find the file, but I think I'm writing the correct path and file name.
    Here is the code and the exception. Can any one try it and tell me what Am I doing wrong.
    Thanks a lot.
    String s = "\\Windows\\iexplore.exe";
    //String s = "\"C:\\Program Files\\Internet Explorer\\IEXPLORExx.EXE\"";
    try
    System.out.println("s: " + s);
    Runtime runtime = Runtime.getRuntime();
    Process p = runtime.exec(s);
    catch(IOException ioEx)
    ioEx.printStackTrace();
    java.io.IOException: Unable to start program
    Stack trace:
    com/ibm/oti/lang/SystemProcess.create([Ljava/lang/String;[Ljava/lang/String;L
    java/io/File;)Ljava/lang/Process;
    java/lang/Runtime.exec([Ljava/lang/String;[Ljava/lang/String;Ljava/io/File;)L
    java/lang/Process;
    java/lang/Runtime.exec(Ljava/lang/String;[Ljava/lang/String;Ljava/io/File;)Lj
    ava/lang/Process;
    java/lang/Runtime.exec(Ljava/lang/String;[Ljava/lang/String;)Ljava/lang/Proce
    ss;
    java/lang/Runtime.exec(Ljava/lang/String;)Ljava/lang/Process;
    com/gestorPosicion/inicio/InicioCliente.main([Ljava/lang/String;)V                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    The problem is that on PocketPC you cannot redirect input or output and the exec() call will not work as expected so it instead throws the exception to indicate this doesn't work on PocketPC.

  • How to start java.exe from a java program in windows ?

    Hi,
    I did like to know, if its possible to run java.exe from a java program on windows ? The java.exe should be visible from checking the processes that are currently running using the Task Manager on windows.

    Runtime.getRuntime().exec("java Sample");

  • Running ssh from within java program

    Hi!
    I am trying to start ssh from within java e.g.:
    Runtime run = Runtime.getRuntime();
    Process pro = run.exec("ssh -l xx 12.12.12.12");
    But it complains:
    socket: Operation not permitted
    ssh: connect to host 12.12.12.12 port 22: Operation not permitted
    Running ssh from the command prompt works just fine. It's run on win xp.
    What is the problem, and how can I avoid it?
    Endre

    Afraid not. I think maybe it's related to security permissions, but I am really not sure. If you can help, I would appreciate it.
    - Endre

  • Shut down Windows 8.1 embedded from within an app

    I am developing a windows 8.1 app with microsoft visual studio. The app shall run in an embedded box PC. From within this app I want to be able to completely shut down the computer. Is there some simple way of simulating or acessing windows/shut down function
    inside my app? If so, how could I write this in visual studio?

    This forum is for Windows POSReady. You might want to try the Mobile Development forum:
    https://social.msdn.microsoft.com/Forums/en-US/home?forum=windowsmobiledev
    Sean Liming - Book Author: Starter Guide SIM (WEI), Pro Guide to WE8S & WES 7, Pro Guide to POS for .NET - www.annabooks.com / www.seanliming.com

  • Opening a document from a Java app

    I need to open a document from my Java app. It is a .rtf file and I would like it to open with the system associated application for rtf files. How should I do that?
    I have tried to figure out the Runtime.exec(), but it doesn't do what I need. I have been able to open Notepad or WordPad (oh, yes, I am on a Win XT system) by specifying them in the exec function, but I can't find info on how to let the system choose the program.
    Thanks for your help.
    Wayne

    Take a look at the JDIC project
    https://jdic.dev.java.net/
    In particular the org.jdesktop.jdic.filetypes.AssociationService class
    https://jdic.dev.java.net/nonav/documentation/javadoc/0.9/index.html

  • Trying to use grep from within java,using exec command!

    Hi all!
    I would like to run a grep function on some status file, and get a particular line from it, and then pipe this line to another file.
    Then perfom a grep on the new file to check how many of the lines above are present in that file, and then write this value to a new file.
    The final file with a numerical value in it, i will read from within java,as one reads normal files!
    I can run simple commands using exec, but am kinda stuck with regards to the above!
    Maybe i should just do all the above from a script file and then run the script file from exec. However, i dont want to do that, because it kinda makes the system dependent,..what if i move to a new machine, and forget to install the script, then my program wont work!
    Any advise?
    Thanks
    Regards

    With a little creativity, you can actually do all that from the command line with a single command. It'll look a little crazy, but it can be done.
    Whether the script exists on the local machine or not has zero to do with platform indpendence. You assumedly have to get the application onto the local machine, so including the script is not really an issue at all. However, you're talking about system independence, yet still wishing to run command line arguments? The two are mutually exclusive.

  • I have purchased a from within an app. I submit my password for the app, and then my Apple ID.  I then get the following messages "Regrant failure _ please log in with the same user that has bought this app"  and that is followed  by "cant conn with IT _

    I have purchased an item from within the app PocketBible on my iPad.  However when I try to download it I am asked for my app User Name and Password and then my Apple ID and password.  I give both of these.  I then get a message which says Regrant failure - Please log in with the same user that has bought the app.  That is then followed by  Pocket Bible Alert - cannot connect to iTunes Store.
    Anybody got any ideas, both what the 1st alert means and how I get round the problem please.

    I had the same problem. My wife had the PocketBible on her Ipad 2 and she transferred ownership to me. I had to delete the app and reinstall it from the App store(logged in with my apple ID) and its working without a problem. I do not get those error messages when I attempt to Buy/Upgrade or Add/Remove books.

  • I am no longer able to send emails from within iPad apps.

    I always used to be able to send files with attachments by email from within iPad apps like Adobe Reader or Pages. Used to work but now it doesn't - and this for all apps all at once. It gets to the point where it has prepared the email, but if you press send, it says "Could not save or send message". It also doesn't matter which email account I use - result always the same. It's a real pain as this was a good way of editing a word file and then emailing it to myself.

    Try a reset: Simultaneously hold down the Home and On buttons until the device shuts down. Ignore the off slider if it appears. Once shut down is complete, if it doesn't restart on it own, turn the device back on using the On button. In some cases it also helps to double click the Home button and close all apps from the tray BEFORE doing the reset.

  • How to restrict the ordering of apps from within an app

    My grandkids somehow run up charges by ordering apps from within an app they are using usually games  without even knowing they are doing it. How do I restrict them from doing it?  And how do I get the charges to Itunes removed when this happens?

    You can go into settings, and restrictions and turn off 'in app purchases'
    You may also want to set your apple id from 'require after 15 minutes' to 'require immediately'
    As to getting the charges reversed you can contact the app developer. Maybe they will reverse the charges, but they don't have to. The terms of sale are that all sales are final.

  • Re-use message mapping from within java mapping?

    Hi there,                                                                               
    I have a question regarding java mapping. What I would like to do is to re-use an existing message mapping from within java mapping.
    Technicaly, message mapping is perfomed by com.sap.aii.mappingtool.tf3.AMappingProgram.execute, right? I would like to call that mapping program for a specifc message mapping from within my java mapping.
    Pseudo java code would look like this:
    public void execute(InputStream in, OutputStream out)
      throws StreamTransformationException {
    com.sap.aii.mappingtool.tf3.AMappingProgram.execute(in,out,'SomeMessageMapping');
    SomeMessageMapping is a message mapping that is defined in the integration repository.
    Is it possible? If so, could you provide me with some details?
    Thank you and best regards,
    Wolfgang

    Hi Wolfgang,
    very interesting idea?
    I would activa a dummy message mapping. than I would have a look in the file directory of the java-stack and try to find out the name of the *.class or *.jar file.
    On the other hand you could generate a tpz-transport-file an unpack this file, to explore the name of the *.class or *.jar
    Unfortunately I do not have access to the file system. So I can't explore the name.
    Regards Mario

  • Currently logged in from within  the app itself

    I need to find out who or how many users are currently logged into my app from within the app itself and display it within a report for the app administrators. Any thoughts or ideas.

    For an answer to this question see this discussion.
    query apex users and their session
    query apex users and thier session
    Todd

  • How to get the Weblogic Server Id from within java code

    I would like to log which server (among a cluster) a certain job is running on. Is there a way to get the server id from within Java code (this code is in a session bean if that is relevant.)
    By server id I mean the "Name" column in the summary of servers on the weblogic console.
    Thanks,
    ken

    Use the two entries close to the bottom of the page: "list WebLogic
    MBeans:listMBeans.jsp
    display MBean attributes and operations:showMBean.jsp"
    Nils
    Anatoly wrote:
    >
    Cameron,
    That page has these items on it:
    which one do you think helps with my issue?
    Misc WebLogic examples
    LongRunningTask
    Execute tasks in parallel using WebLogic Execute Threads
    Weblogic stats (5.1)
    Reload Servlet(s) programmatically (5.1)
    Network classload from WebLogic:using reflection,or the launcher
    Weblogic 5.1 debugging properties
    Seppuku pattern readme
    Using dynamic proxies to intercept EJB invocations (6.1)
    list WebLogic MBeans:listMBeans.jsp
    display MBean attributes and operations:showMBean
    Thanks to Marcelo Caldas for filter by type option and nice UI!
    Using com.sun.jdmk.comm.HtmlAdaptorServer with WebLogic 6.1
    Cool
    EJBGen
    Dimitri
    back
    "Cameron Purdy" <[email protected]> wrote in message news:<3c7a745d$[email protected]>...
    JMX ... see http://dima.dhs.org/misc/ for some info on JMX in Weblogic.
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    Clustering Weblogic? You're either using Coherence, or you should be!
    Download a Tangosol Coherence eval today at http://www.tangosol.com/
    "Anatoly" <[email protected]> wrote in message
    news:[email protected]..
    Does anyone know who to get the managing server URL's port
    from within the EJB code running on Weblogic 6.1?
    The URL port is not default (not 7001), but when creating
    initial context, I am not specifying the URL in properties.
    Due to that, trying to the the PROVIDER_URL property from
    environment does not return anything.
    Appreciate any responses.
    -Anatoly
    ============================
    [email protected]

  • All remaining strore credits stolen yesterday, about 50$.  It appears to be a purchased made from within an app.  Anyone else? Does AAPL refund.  They sent me an e-mail to advise me that an untautorized computer had completed a purchase...what he %$/ ??

    All remaining strore credits stolen yesterday, about 50$.  It appears to be a purchased made from within an app that I neved downloaded. Anyone else? Does AAPL refund.  They sent me an e-mail to advise me that an untautorized computer had completed a purchase...what he %$/ ??

    I've not dealt with the app store, so I don't know how to address the problem from the standpoint of dealing with Apple; but, it appears that someone has hacked into your account and used up the money. I would immediately change my password (make it difficult!!) and then deal with the app store. Was this cash? If it was a credit card, I would call them immediately, tell them what Apple said, and file a complaint - you should be getting a credit for that amount.

Maybe you are looking for

  • Error Message when taking video after OS 4.3 update

    Anyone else getting this message "This movie format is not supported" after taking video? This just started after the OS 4.3 update. I did turn the phone off and on just to see if it was a fluke but it still happens. Thanks ~Ken

  • What's wrong with this simple code?

    What's wrong with this simple code? Complier points out that 1. a '{' is expected at line6; 2. Statement expected at the line which PI is declared; 3. Type expected at "System.out.println("Demostrating PI");" However, I can't figure out them. Please

  • Call RFC in BSP

    Hi all Can anybody suggest me how to call the remote function module from a another SAP system. When i give the destination and call the FM it is opening a new GUI window promting user id and pwd. Is there a way to skip this and call the remote FM.

  • Mousepad Issues on Macbook Pro

    I have a Macbook Pro with the latest OS LION 10.7.3 The problem is with my mousepad. Sometimes the mousepad hangs on to certain elements on the screen and highlights things unnecessarily, and will also not be responsive. It also has trouble scrolling

  • House episode wont work??

    i bought an house episode and i got it with HD and i downloaded HD cause the original got deleted and when i try to download it says episode cannot be played on this ipod and its the ipod touch 2nd gen software 4.0 8gb so why wont it work? also all t