How to end a process from cmd.exe?

I need to open and close a word file(Test.doc) from my java program. I managed to open the file using cmd shell, but I don't know how to close the opened file. Does anybody have a suggestion? Below is my code. Thanks.
    Runtime r = Runtime.getRuntime();
    Process p = null;
    try {
    p = r.exec("cmd.exe /c start Test.doc");
    catch (Exception e) {
      System.out.println("Error opening the file.");
    }

Try something like this:
Runtime r = Runtime.getRuntime();
Process p = null;
String command = "\"C:\\Program Files\\Microsoft Office\\Office12\\winword\"";
String file = "\"c:\\Test.doc\"";
try {
    p = r.exec(command + " " + file);    //to open the file in MS Office Word
    Thread.sleep(30000);    //keep it open for 30secs
    p.destroy();    //close the process and hence the file
}catch (Exception e) {
    System.out.println("Error opening the file.");
}Edited by: Sourav-Sipani on Jul 28, 2008 1:56 AM

Similar Messages

  • How to invoke business process from sap xi?

    Hi...
    Please tell "How to invoke business process from SAP UI's."

    Hi...
    How to invoke business process from SAP UI's. (Eg: To trigger a process after creating an invoice)

  • How do you keep processes from starting up?

    i have no HP software from on my computer and i still have HP's process starting up on my computer. i need to know how to keep a process from starting up. i know in windows you do MSCONFIG, does OS X have anything like that? thanks.

    As the Hatter said, get EasyFind:
    http://www.devon-technologies.com/download/
    It's free and a nifty little program. Spotlight is programmed to not search in most system folders so will not find many of the pieces of an app you want to de-install. EasyFind will look in those places so you can delete whatever else of the HP app is still around.
    Kevin
    http://www.bearbyte.blogspot.com/

  • How to invoke BPEL process from JAVA API

    Hi Guys
    Any idea if you can tell me how to invoke BPEL process from JAVA API ?
    What to do in BPEL process manager to achieve that?
    Regards
    Deepak

    See http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28981/invoke.htm#sthref1373 and the JavaDocs http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28986/toc.htm.

  • How to call a process from another project

    Hi;
    How to calling a process from another process in another project? Which activity that i need or web service, direct binding? I use 11g

    Hi Tulasi ;
    I have wsdl of the process i need to call. Also wsdl address on the server. But CALL activity can't use to service call. CALL activity can use only to reusable process call.
    I think, this operation must make on composite.xml. But I have a same problem with this method and it don't work.
    I create a base process that looking at below. It's include a direct binding. Is it include a direct binding?
    [Base Process|http://d1201.hizliresim.com/t/s/21wqu.png]
    Then i create a process that call to base process:
    [Caller Process|http://d1201.hizliresim.com/t/s/21wqx.png]
    I paste to base process' wsdl address on the server. Then i select port type (BaseProcessPortType) and a warning has occured that you see the picture above. Base Process contain Oracle SOA Composite Type. What's the wrong? It happened for Callback Port Type.
    And second question is what's the Address? (under Reference Binding Setails option).
    I think, i create the this direct binding correctly, i call to base process into my caller process via service activities.

  • When I enter the website, Firefox stops responding and I have to end the process from the Task Manager. How do I solve this problem?

    I am running Firefox 4.0 beta 7 on Windows XP Tablet Edition OS. When I enter this site using Firefox, the browser stops responding and I have to end the process using Task Manager. However, when I open it with other browsers such as IE8, I am able to view the site as per normal. This only happened when I updated my browser to Beta 7 and I did not have such problems in the previous betas.

    There is [[Flash]] content on that page.
    Do you have a problem with Flash on other websites?
    Create a new profile as a test to check if your current profile is causing the problems.
    See [[Basic Troubleshooting#Make_a_new_profile|Basic Troubleshooting: Make a new profile]]
    If that new profile works then you can transfer some files from the old profile to that new profile (be careful not to copy corrupted files)
    See http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • Firefox hangs on a website won't allow me to select links within the website. when i restart firefox it won't open. i have to end the process from the task manager

    when i visit a site called clubforeplay.com it won't let me view any of my friends profiles. when i try to navigate away firefox does not respond. when i close out of firefox and try to reopen it. i get nothing. i have to physically go into the task manager and end the firefox.exe process manually before i can go back. i have tried to uninstall and then reinstall firefox with no luck. it is starting to affect my firefox in different websites

    i'm using firefox 3.6.13 and windows XP home SP3. when i visit zynga poker at facebook.com it turn slowly to open the application. when i try to navigate away, firefox does not respond. when i close the firefox and try to reopen it, i get nothing. i have to physically go into the task manager and end the firefox.exe process manually before i can go back. i have tried to uninstall and then reinstall firefox, but it didn't work, i tried also to sending the crash report from crashreporter.exe, the warning box said: "This application is run after a crash to report the problem to the application vendor. It should not be run directly", what should i do?

  • Redirecting output from 'cmd.exe /c'

    I am using Powershell 2009 on a WIN-Server 2008 R2
    I have seen several suggestions on how to "redirect" the output generated by a 'cmd.exe /c', but none of the suggested solutions were successful.
    I have a simple cmd
    cmd.exe /c my_program.cmd $file.basename
    This process creates a lot of screen output and this command is in a loop of all files in a directory.
    I want to capture the output to a file "$lgfile"
    I have used
    {content}
    >> $lgfile
    {content}
    Out-file -filepath $lgfile [no output]
    {content}
    `$lgfile 2`>>`&1 [error '&" is reserved for future use]
    I would be grateful for any suggestions
    Also, the reason I am using "cmd.exe /c" is because that is the only method i have been able to use successfully (my_program.cmd is calling an ORACLE compiler! and all other methods to execute this compiler did not work except as a cmd-file)

    I usually just pipe to Set-Content:
    cmd.exe /c my_program.cmd $file.basename | Set-Content $lgfile
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • Execute Script (batch processing) by cmd.exe?

    Hi! Is there a possibility to execute some scripts (batch processing) via the command line (cmd.exe)?
    It's very important to me to know if there still exist a possibility (and of course I like to know how it works and what I have to type...)
    Thanks in advance!

    No, there is not.
    Leonard

  • How do I install Photoshop from the .exe files I got from Adobe?

    I downloaded Photoshop CS2 from Adobe's site.  That download gave me 5 .exe files, including CreativeSuiteCS2Disc1.exe, CreativeSuiteCS2Disc2.exe, and CreativeSuiteCS2Disc3.exe. 
    When I clicked on CreativeSuiteCS2Disc1.exe, files were extracted and installation began.  I put in my serial number and other information, and things seemed to be going fine.  Then a window popped up with the message "Please insert Disk 2."  Well, I don't have a Disk 2.
    My download included a file "CS2_install_Win.pdf."  In those instructions, it says "the InstallShield wizard may return an error, "Please insert disk [ number ]." If this error occurs, click OK in the dialog box and then double-click the disk image to which the installer refers to manually extract the disk and complete the installation."  So, I clicked on CreativeSuiteCS2Disc2.exe, which overwrote the extracted files from CreativeSuiteCS2Disc1.exe.  But the box saying "Please insert Disk 2" didn't go away. No matter how many times I clicked "OK" it just stayed there.  
    Still, CreativeSuiteCS2Disc2.exe ran, and when it was done I got a message that installation was complete.  But, when I tried to run CS2, I got an error that my serial number and organization were invalid or not installed properly.  I know they were installed because I put them in when I ran CreativeSuiteCS2Disc2.exe
    So, given that following the pdf instructions that came from the download don't seem to work, can anyone out there offer me better instructions on how to do this installation?  I was thinking of extracting each .exe file to a CD, then just inserting those CDs one at a time.  Will that work?

    Missing personalization infopoints to permissions/ user privileges issues which are to be expected with such old versions on contemporary operating systems. Run as admin, turn off security stuff, try compatibility modes. Actualyl burning the discs will of course work, but you might look into simply mounting folders/ disc images as virtual drives e.g. using Daemon Tools Lite or your disc burning software's own disc mounter.
    Mylenium

  • How to call BPM process from Java

    Hi All,
    Can anybody help how to call a BPMN process from java.Please give any sample exaple on this.
    Thanks,
    Ganesh

    For 11g BPM please look at this post. Re: Getting while running the BPEL process from java
    It references an ATeam example app that can start processes from a web client. But the Java APIs are described too.

  • How to trigger BPM Process from SRM Portal

    Hello Experts,
    I'am new to BPM and NWDS 7.3 but experienced with Abap and NWDS 7.0 Development...
    Before posting, i have been through the forum and couldn't find exact answer to my case..
    Basicly what i need to do is to trigger BPM Processes on the BPM Server from SRM Portal Server, I'm aware that i can communicate between these servers with WSDL basicly but how am i going to call the BPM Process' Web Service from Standart SRM  Processes?
    These processes will be standart ones mostly and also i am new to SRM.
    Kindest Regards,

    SAP SRM 7.0 user interface is developed in WebDynpro and runs on NetWeaver Portal (Portal was optional component in earlier versions of SRM but it is mandatory component now). So in order to call BPM Webservice (i.e., to trigger a BPM Process) from NetWeaver Portal / SRM 7.0 you can do the following
    - Develop a custom application (using EJBs,etc) to call the BPM web service by creating a web service proxy client using NWDS and then deploying it on Portal Server.
    - Directly create a model in WebDynpro project by using the WSDL of BPM trigger webservice (using NWDS). You can then call the model in WD User Interface, which in turn will invoke the BPM web service and start the process.
    Hope this helps.

  • Hi There, Any one Know How To Call Workflow Process From Special Menu.

    Hi There,
    Any one Know How To Call Oracle Workflow Process From Special Menu.
    I mean Tool -> Special Menu 1-45
    Or How to call Oracle Workflow Process From Command Button.
    Thanks
    Bachan.

    Can u give me some examples.
    Second thing we can add special action (special Menus) from Form Personaliztion.
    But how to add launch wft through Personalization
    Please Give me a breaf detail.
    Thanks
    Bachan

  • How to run GP process from ABAP Workflow

    Hi All,
    Can anybody tell me in detauls how can I run a GP process from ABAP workflow. What configuration are required for that in J2EE engine side as well as ABAP side.
    Thanks
    Chandan

    Hi Chandan,
    see <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/b1/259142d4d4b81ce10000000a1550b0/frameset.htm">here</a>, maybe this help.
    Ciao
    Luca

  • CAN I END THE PROCESS NAMED sapissvc.exe

    Hi
    When I see in the task manager of windows server 2003 it shows that the application named as sapissvc.exe is using more number of CPU's. Can you tell me what is it? And is there any bad effect if i end the process of this application.
    Regards
    Rajneesh

    Hi,
    According to search result, sapissvc.exe belong to a program named Quick Heal Scanner.
    If it is installed and you do not need it any more, it is recommended to uninstall it instead of blocking the process.
    If you have any feedback on our support, please send to [email protected]

Maybe you are looking for