How can i run external application without specifying the full path?

for example, ms word executable file is winword.exe, but in java i am using the following command:
Runtime.getRuntime().exec("\"C:\\Program Files\\Microsoft Office\\Office10\\winword.exe\");
the thing is, i dont know where ms word is installed on every machine, so rather than making an assumption, do you know how i can run ms word without specifying the full path?
thanks

1) You could ask the user to tell you where it's at (and remember for next time)
2) You could do a file search for it (and remember it for next time)

Similar Messages

  • How to call or open without specifying the full path?

    hi all,
    how to call or open without specifying the full path?
    for example the following code of a when_button_pressed trigger.
    call_form('c:\test\student.fmx',hide,do_replace);
    open_form('c:\test\student.fmx');
    i want to specify only the form name.
    call_form('student.fmx');
    open_form('student.fmx');
    i m using developer 2000.
    regard
    Muhammad Nadeem
    [email protected]

    HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\FORMS60_PATH=c:\test\;c:\orant\bin;...

  • How can I start an executable without specifying the directory?

    I have downloaded the tor browser bundle and I would like to be able to start it with a command like "torbrowser" and not by specifying the full directory?

    I don't think it is a good idea to put it in /usr/bin at all but if you must, isn't it safer to move it there, as Trilby suggested? And change the permissions appropriately? That doesn't strike me as especially wise but it seems better than symlinking to an executable in your home directory from /usr/bin.
    One way to mitigate security threats is to limit the PATH root uses. So for an ordinary user, you might include /usr/local/bin or ~/bin. But for root, you wouldn't include these. This makes it a little bit harder to run something malicious as root inadvertently. If you start symlinking to executables in your home directory from /usr/bin, you defeat this. For example, I use this PATH for root:
    /usr/bin:/usr/sbin:/bin:/sbin:/usr/bin/vendor_perl:/usr/bin/core_perl
    So root can't even run stuff under /usr/local on my machine without explicitly giving the path. But if I symlinked from /usr/bin to stuff under ~/, there would be no point in the restriction.
    EDIT: but I just realised sudo can... damn!
    Last edited by cfr (2012-06-24 00:39:59)

  • How can I save a PDF without specifying the directory?

    When I try to save changes I made to a PDF (highlighting and/or commenting), I'm prompted to specify which directory I'd like to save to, and I have to verify that "yes, I want to overwrite the existing file that has the same name". I just want to save the changes I made to the file I made the changes in. Is there a setting I can change to skip all the hassle?
    I'm using Adobe Reader XI and windows 8.1.
    Thank you,
    Ted

    I don't think it is a good idea to put it in /usr/bin at all but if you must, isn't it safer to move it there, as Trilby suggested? And change the permissions appropriately? That doesn't strike me as especially wise but it seems better than symlinking to an executable in your home directory from /usr/bin.
    One way to mitigate security threats is to limit the PATH root uses. So for an ordinary user, you might include /usr/local/bin or ~/bin. But for root, you wouldn't include these. This makes it a little bit harder to run something malicious as root inadvertently. If you start symlinking to executables in your home directory from /usr/bin, you defeat this. For example, I use this PATH for root:
    /usr/bin:/usr/sbin:/bin:/sbin:/usr/bin/vendor_perl:/usr/bin/core_perl
    So root can't even run stuff under /usr/local on my machine without explicitly giving the path. But if I symlinked from /usr/bin to stuff under ~/, there would be no point in the restriction.
    EDIT: but I just realised sudo can... damn!
    Last edited by cfr (2012-06-24 00:39:59)

  • How can i run Webdynpro application

    How can i run Webdynpro application without using Developer Studio? Where should i put a whole project and how shoud i start it.
    Thanks!
    Maciek

    Hi Maciej
    You wouldnt require a Developer Studio to run you
    application.But you would require it to deploy (if are
    using the JDI ,atleast to perform an Activation).
    However you can launch the application once deployed
    through the Web Dynpro Content Administrator
    http://<servername>:50000/webdynpro/welcome/
    The deployed applications are present on the
    lefthandside. They can be expanded to drill down to the
    Application and the press Run
    Regards
    Pran

  • TEXT_IO.FOPEN how to pick file without specifying the full directory path

    Hi,
    I am using Oracle application server 10gR2 on Linux with forms 10g application. I am building the DEV/TEST/UAT environment on same Linux machine with one OAS.
    I am using TEXT_IO.FOPEN ('/home/oracle/check.txt','r') to read a server side file and it is working fine.
    Now I want to pick this file dynamically i.e. without specifying the full path. I am using TEXT_IO.FOPEN ('check.txt','r') and I copied file in forms_path directory in linux and even in $path directory in linux but none of them are working.
    Pls help me sort out this problem.
    Thanks in advance

    Hi,
    I have to read files in my app directory using TEXT_IO how is that possible?? I cannot set workingDirectory as my Oracle home is in a different location and as has been mentioned by others when I run the form on web it cannot seem to find the file in the default forms directory where all the .fmx file
    Is there any other file setting that needs to be done??
    Please help
    Thanks & Regards
    Mangesh Deshpande

  • How can I use this account without specify credit cards, only for free applications ?

    How can I use this account without specify credit cards, only for free applications ?

    Click here and follow the instructions.
    (94222)

  • Run External application without Exiting main application

    Hi,
    I am trying to implement a function that executes the external program from within my java application. I am using windows xp. I had googled for this and found some code but so far I am able to run the application in a condition if my main application exits. Instead I want to run the application without exiting my main application. How can I do that:
    Code I am using is:
    ========================
    try{
    Runtime.getRuntime().exec("external program");
    System.exit(0);
    catch (Exception err){
    err.printStackTrace();
    System.exit(-1);
    =========================
    my problem is I cannot run the external program without the line "System.exit(0)". If I remove that line, the external program only starts after I exit my main java application. Is there a way to run the external application without leaving the main application?
    By the way I am using the latest version of JDK 6 update 2 and Netbeans 5.5.1
    Thanks

    I tried and I tried and I couldn't make the same problem occur unless I specfically had a long task execute BEFORE calling the runtime command. See the code below:
    I tried a bunch of things, including having a GUI run before the Runtime call, after the runtime call. Neither affected the movie from being played.
    I tried with different versions of the runtime command, none of it made a problem.
    I tried running the application with a long task that would keep the main thread busy for a while AFTER I launched mplayer - no problem.
    The only thing that made the app work the way you describe was when I built the long task that keeps the main thread active for a while BEFORE I launched mplayer (which is the state of the code as I pasted it below).
    So my guess is that you have a single threaded application and you add the call to mplayer at the very end of your program's execution - thus it doesn't get called until the last thing. My suggestions:
    1) Move the call to the Start of your code, not the end
    2) Move your other work to a new thread so that it can be kicked off without holding the main thread in check.
    package movies;
    import inheritance.BaseWindow;
    import java.util.*;
    import java.io.*;
    class StreamGobbler extends Thread
        InputStream is;
        String type;
        OutputStream os;
        StreamGobbler(InputStream is, String type)
            this(is, type, null);
        StreamGobbler(InputStream is, String type, OutputStream redirect)
            this.is = is;
            this.type = type;
            this.os = redirect;
        public void run()
            try
                PrintWriter pw = null;
                if (os != null)
                    pw = new PrintWriter(os);
                InputStreamReader isr = new InputStreamReader(is);
                BufferedReader br = new BufferedReader(isr);
                String line=null;
                while ( (line = br.readLine()) != null)
                    if (pw != null)
                        pw.println(line);
                    System.out.println(type + ">" + line);   
                if (pw != null)
                    pw.flush();
            } catch (IOException ioe)
                ioe.printStackTrace(); 
    public class MyMainClass
        public static void main(String args[]) throws InterruptedException
             //This is just a GUI as a test
            BaseWindow bw = new BaseWindow();
            bw.show();
            //Keep App Running for a while
            int count = 0;
            while (count < 200) {
                 Thread.sleep(20);
                 count++;
                 System.err.println(count);
            if (args.length != 1)
                System.out.println("USAGE java movies.MyMainClass \"<movie to play>\"");
                System.exit(1);
            try
                Runtime rt = Runtime.getRuntime();
                //String[] cmds = new String[] { "cmd", "/c", "C:\\Mplayer\\mplayer.exe", args[0]};
                //String[] cmds = new String[] { "C:\\Mplayer\\mplayer.exe", args[0]};
                //Process proc = rt.exec(cmds);
                Process proc = rt.exec("C:\\Mplayer\\mplayer.exe "+args[0]);
                // any error message?
                StreamGobbler errorGobbler = new
                    StreamGobbler(proc.getErrorStream(), "ERROR");           
                // any output?
                StreamGobbler outputGobbler = new
                    StreamGobbler(proc.getInputStream(), "OUTPUT");
                // kick them off
                errorGobbler.start();
                outputGobbler.start();
                //Keep App Running for a while
    //            int count = 0;
    //          while (count < 2000000) {
    //                 Thread.sleep(200);
    //                 count++;
    //                 System.err.println(count);
                // any error???
                int exitVal = proc.waitFor();
                System.out.println("ExitValue: " + exitVal);
            } catch (Throwable t)
                t.printStackTrace();
    }I will restate myself:
    "I was not able to repeat the problem, except as described, as long as I took the hints mentioned in the article I posted into account and actually put them into action."
    Of course, as soon as I ignored those hints, I was able to reproduce the error described above quite easily in all the different tests I made... But I guess the OP implemented those fixes, right? He did say he read the article...
    Message was edited by:
    stevejluke

  • How can I run ni488216.exe without any prompts during installation?

    How can I run ni488216.exe without any prompts during installation (Silent mode)?

    Typically you can do a silent install of the NI-488.2 software by running:
    setup.exe /S LV_INSTALL path=
    Regards,
    Greg Caesar
    National Instruments
    Applications Engineer

  • How can I run external console program, printing output to JTextPane?

    How can I run external console program, printing output to JTextPane?
    I have a console app. written in C++ and I would like to run in it from java swing app. and I would like to see its output in a JTextPane.

    I have used this article
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    to successfully pipe output from jboss batch files to a JTextPane.

  • How can I add new games without overwriting the old ones?

    I have just purchased two new games in the itunes store and although they are showing in the library (under applications) my previously purchased games are not. In Summary under games it will not let me choose selected games only 'all games' and when I press sync warns that the existing games will be replaced. How can I add these games without deleting the older ones? Also if I did want to remove a game from my ipod how do I do it?

    hardlyquinn wrote:
    Part of the problem is that I can never sync the whole thing as I dont keep all my music in my library (it seems silly to have my enture cd collection on the computer).
    Clearly it ISN'T silly as it avoid issues like you are having right now. If you need more space, get an external hard drive. To me it is much sillier to only have your stuff on the iPod and no where else as the iPod, as a small portable player, is much more likely to be dropped, lost, damaged, stolen, forgotten somewhere, etc.
    While I am not familiar with the use of games on the iPod (I have never bought any) you can switch the iPod to manually manage and then you can add content to your iPod without losing what is already there. Perhaps it works for games as well.
    But long term, I strongly suggest you keep all your stuff in your library so if you need to (you have to perform a restore on the iPod, you lose it and buy a new one, etc.) you can very easily sync it all back to the iPod when needed.
    Good luck,
    Patrick

  • How can I run 2 Dreamweaver windows at the same time?

    How can I run 2 Dreamweaver windows at the same time on my
    PC?
    basically I have 2 monitors and I want to edit CSS on one
    monitor and have the html page open on the other so I can quickly
    look from one to another with in a split second instead of taking
    that extra time to switch back and forth using the tabs at the top,
    I know I should probably invest into a mac so i can work out side
    of the Dreamweaver application window and I will in the future but
    is there any way i can do this on my windows XP pro PC?
    Thank you
    Maurice

    Open the CSS in DW, and use F10 to open the Code Inspector.
    Place the
    latter as needed.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Random_Yggdrasil" <[email protected]> wrote
    in message
    news:gi2htb$j4j$[email protected]..
    > How can I run 2 Dreamweaver windows at the same time on
    my PC?
    > basically I have 2 monitors and I want to edit CSS on
    one monitor and have
    > the
    > html page open on the other so I can quickly look from
    one to another with
    > in a
    > split second instead of taking that extra time to switch
    back and forth
    > using
    > the tabs at the top, I know I should probably invest
    into a mac so i can
    > work
    > out side of the Dreamweaver application window and I
    will in the future
    > but is
    > there any way i can do this on my windows XP pro PC?
    >
    > Thank you
    > Maurice
    >
    >
    >

  • I have three iPads and one iPod and one iPhone.  How can I message between them without sending the message to all of them.  You send the message to your email address but all of them are set up und one account.

    I have three iPads and one iPod and one iPhone.  How can I message between them without sending the message to all of them.  You send the message to your email address but all of them are set up under one account.

    You can have a different receiving email in the Messages app on each device : Settings > Messages > Receive At . I'm not sure that there is a different way to have the message only go to one device.

  • I want to download an audiobook, but my daughter has a giftcard credit on the account. How can I download my audiobook without using the money from her giftcard?

    I want to download an audiobook, but my daughter has a gift card on the account.  How can I download my audiobook without using the money from her gift card?

    go directly to your ibook app. and you're going to find it. it's only with ibooks app.
    best
    Olivier
    <Edited by Host>

  • Everything on all the webpages are so small, and only take up half the screen. How can I make it bigger, without changing the settings on my computer and by that change the size of everything on my computer.

    Everything on all the webpages are so small, and only take up half the screen. How can I make it bigger, without changing the settings on my computer and by that change the size of everything on my computer.

    The Firefox [https://support.mozilla.com/en-US/kb/Page+Zoom Page Zoom] feature does a domain by domain level of saving the users preferred zoom level settings, there is no default Page Zoom level setting in Firefox, as with some other browsers.
    Try the Default FullZoom Level extension: <br />
    https://addons.mozilla.org/en-US/firefox/addon/6965
    Or the NoSquint extension: <br />
    https://addons.mozilla.org/en-US/firefox/addon/2592/

Maybe you are looking for

  • Soon-to-be Macbook Pro convert asks questions

    Hi there! I have had Windows PCs in the past and i want some change. i want to do things more quicker & simplier. I have been researching for the past week or so a comparison on Apple Macs and the latest crop of Windows 7 laptops and i wanted to ask

  • Weblogic webservices and JSP

    Hi Folks, I have been stuck with this issue for quite sometime now. I have developed a simple webservice using a java class. It looks something like this.. public class ReceiveMessageClass{    public void receiveMessage(String msg){       logIt(msg);

  • RAW support for new camera in Bridge CS3

    Hi all I have PS Elements 6 on a Mac and have updated to ACR 5.2 which allows Elements to open the RAW files from my new Panasonic G1 camera. However, I have to do this direct from Elements as I get the message in Bridge that 'this version of Bridge

  • How do I convert from the try & buy license to the full license?

    Hi, we ordered a new Imq2.0 license after our JmQ2.0 beta license expired. Since it will take a few weeks to get that through the government purchasing process, I downloaded the latest try & buy imq from iplanet so we can continue our development whi

  • Checking for mouseReleased event

    Hi, I am trying to find out how to "look ahead" if a mouseReleased event is about to happen, from within a mousePressed method. Here is the pseudocode: mousePressed(....){ while( mouseNotreleased){ //perform some long running task here. mouseReleased