Problem opening a file from Runtime.exec()

hi
I'm trying to open a certificate (.cer), from my java code.
If I go on a windows command, and I type only the name of my certificate ( f:\certificate.cer), it is opened.
If I use the java code
Process process = Runtime.getRuntime().exec("F:\\certificate.cer");it doesn't work:
java.io.IOException: CreateProcess: "f:\oid.crt" error=193
anybody knows what I can do to make it work?
Thanks in advance
Philippe

For windows you need to used the cmd.exe to do what you want.
i.e. cmd /c f:\certificate.cer
Process process = Runtime.getRuntime().exec("cmd.exe /c F:\\certificate.cer");At a command prompt, for more help on cmd.exe type: cmd /?
Also for help on a related command, type: start /?
Also read http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

Similar Messages

  • Problem opening pdf file from an app built by Flash Builder 4.5

    problem opening pdf file from an app built by Flash Builder 4.5

    The iPad and iPhone have NEVER supported Flash and never will. In fact, Adobe is no longer distributing Flash builds to mobile devices.
    Time to move on...

  • Problems opening pdf-files from KM of portal

    Hi,
    we store documents in our portal in KM. When I use pdf-files that where not saved with Office2007 tools I get the problem, that I can open the file once. If I open it the second time I get the error message "file doesn't start with "%PDF-". and the file will not be opend. If I delete the temporary files in the internet explorer, the file can be opended, again.
    If I open the file directly in the internet explorer I don't have those problems, so it seems, that the portal uses a different viewer than the internet explorer itself. 
    Has anyone an idea how to solve this problem?
    Regards
    Ulrike

    Ulrike,
    I think this is a known issue.
    Affected versions:
    o KMC SAP NetWeaver 7.0 (formerly named 2004s) SP 14
    o KMC SAP NetWeaver 7.0 (formerly named 2004s) SP 15
    If you have the above KMC and SP Versions then you need to follow the below SAP note:
    Note 1146711 - Problem opening PDF files.
    Have you checked the belowSAP Note?
    Note 954627 - Issues with opening/displaying PDF files from KM
    Regards,
    Karthick Eswaran

  • Problem opening Illustrator files from Bridge

    I recently installed cs5.5 and can no longer open my Illustrator files from within Bridge.  When I double click on the file in Bridge, it switches to Illustrator and the hour glass appears for about 5-10 seconds before switching back to the selector tool, but the file never opens???  The only way I can open Illustrator files now, is to do the File>Open command within Illustrator. 
    I'm hesitant to reinstall CS5.5 because it took so long the first time. 
    Any suggestions??
    Thanks
    Paul

    It only seems to affect ai files.  I am able to open psd files from Bridge.
    I just discovered that I am also unable to "place" ai files in InDesign.  The same thing happens - I go to File>Place, find the ai file, double click the ai file, the hour glass appears for a brief moment then disappears, but the file doesn't get placed.
    Thanks for any suggestions.
    Paul

  • Problems opening PDF files from Websites

    I just had the contents of my (dying) ibook transferred onto my emac. The tech created a new user/desktop on the emac. Now, when I try to open PDF files from a website, I get a window saying this:
    "Downloading - users/myname/desktop/xxxxx.pdf could not be saved because an unknown error occurred. Try saving to a different location."
    Points to note: 1) The "xxxxx.pdf" part of the above message changes each time I try to open a pdf document, even the same one, and it does not show the real name of the document (e.g. CollegeApplication.pdf)
    2) this never happened on my laptop;
    3) the settings are set in Firefox to download pdf's to my desktop;
    4) I have the latest version of Adobe Acrobat, which I already tried opening before downloading.
    Any ideas? Thank you!

    Will the new account save to a different location?
    Is the "myname" that appears in the error message that of the new account or of the old one?
    Following up on Frank's tip about file permissions, is it possible that the GID of the new user account conflicts with the existing? The existing admin user was likely GID = 501 on both Macs, and depending on how the laptop's data was transferred, the internal ownership of the transferred files still points to 502 rather than say 502.
    have you tried the old standby of running Disk Utility's Repair Permissions on the hard drive?

  • Opening a file via Runtime.exec() on Mac OS X

    I'm having a hard time opening a file programatically on Mac OS X.
    The following code works only if the filepath/filename doesn't contain a space:
    String filepath;
    Runtime rt = Runtime.getRuntime();
    rt.exec( "open " + filepath);From a terminal, typing open + surrounding the filepath with either apostrophes or quotes and OS X will open the file no problem, even if it has spaces.
    So I tried modifying my call:
    filepath = "\"" + filepath + "\"";
    rt.exec( "open " + filepath);...then nothing happens. No error, no popup, no exception thrown...nothing. Same thing if I use apostrophes vice quotes.
    Any ideas? I'm using JDK 5.0 as 6.0 is not yet supported by Apple.
    Thanks in advance.

    assuming open is an app, not a command within a shell... what about this:
    String[] cmd = { "open", filepath }; // with out quotes
    rt.exec(cmd);

  • I cannot open any .doc files on Firefox from any source such as yahoo mail, blackboard, and UW Catalyst, while I have no problem opening .docx files from the same sites. When then happens, I have to switch to explorer and it's really annoying.

    Cannot open Microsoft Word .doc files from any website (.docx are ok)

    That is a legitimate Mozilla newsletter. As it says in the email:
    You're receiving this email because you subscribed to receive email newsletters and information from Mozilla. If you do not wish to receive these newsletters, please click the Unsubscribe link below.
    Unsubscribe https://www.mozilla.org/en-US/newsletter/existing/ad9febcf-65ac-41fd-810b-798945f448f3/
    Modify your preferences https://www.mozilla.org/en-US/newsletter/existing/ad9febcf-65ac-41fd-810b-798945f448f3/ "

  • Problem open pdf files from windows xp or W2K3(Not from Windows 7)

    Hi,
    i have some pdf files in a shared folder(W2K3).These are in other subfolders.Some of them cannot be opened .Right click options are limited (photo below).The weird thing is that happens when you try to open the files either from the server or a windows xp machine.From Windows 7 are opening normally.I thought of being an issue with file directory .Any idea ?
    Thanks

    I had to install adobe reader, but   PDF's used to display just fine with IE, any idea what happened ?
    Windows 8.1 pro.
    thx
    lee

  • Problem opening a file from a command line executed program with args

    I have to run my program from the command prompt like this:
    c:\ java Parser template.txt keyvalue.dat output.txt
    I figured out how to read the args in, and I know they are being assigned to the proper variables. My template.txt, etc are in the same directory that I am in when I run the program. They are also all lowercase, just like the command.
    The only error it throws is the one that I coded (Error opening file template.txt) I would make my message better if I knew what the problem was!!!!
    Any ideas (either for what I'm missing or how to improve my error handling) :\
    Jen

    After catching the exception, call the printStackTrace() to have it print out the error it caught, as well as the file and line number it occured on...

  • Custom RH9 WebHelp skin: Problem opening PDF file from custom button

    Hi, I've been troubleshooting and checking forums trying to figure out how to get a PDF file to open from a custom button on my WebHelp skin. It worked for me once upon a time, but I changed something in the document and tried to upload the new version and it has errored out ever since.
    I want to have the ability to open the PDF in a new window from the custom button (called 'Printable PDF' on my skin), so I am using the following custom JavaScript in the 'Click On' field of the the custom button's components: window.open('print_test.pdf','printWindow','menubar=0,resizable=0,width=900,height=500,scr ollbars=1');  I know the script is good because I have the same script for the Support custom button and it works great. The only difference between those scripts is the Support script calls an .html file instead of a PDF and the window names says 'supportWindow' instead of 'printWindow'.
    I've tried deleting and recreating the custom button, changing the JavaScript with a developer's help, generating the help on another machine thinking it was a glitch with my browser (using IE8) or RoboHelp license, and combing the help files numerous times. I've also ensured that the PDF file is stored in the skin and project folders along with the other project files/folders. I've used previous versions of RoboHelp and had no problems attaching a Word document and PDF, so I'm wondering if this is a bug in RH9?? Especially since it worked for me initially. Any assistance and/or fresh ideas are welcomed! Thank you!

    Hello again
    Happy I was able to help.
    MOTW is only present and affects things when you are running content off your local C drive. It's value is in preventing that Yellow Information Bar and all that from appearing when you are using IE. Once you publish content to a server and access it that way you are in a different security zone and MOTW has no influence either way. So there would be no adantage to enabling it before publishing to a server. The only reason you might want to consider enabling it would be if you were copying the WebHelp to everyone's hard drive and having them run it from their hard drives.
    Make sense?
    Hope so... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7, 8 or 9 within the day!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • CAN'T OPEN  PDF FILES FROM CANADA'S CIC SITE

    I can't open at least two files/forms from the CIC - Canadian Immigration site.   I have no problems opening other files from the same website but for 2 particular forms its message was the Adobe reader you're using may not be able to open... you need to upgrade to the latest version of the Adobe reader which i did and still could not open these forms.   Help please.  Thanks @

    What is your operating system?  Browser?  Reader version?
    Have you tried to download these PDFs to your local disk first, then open them from there?
    Finally, can you post links to the PDFs you have difficulties with?

  • Aperture wont open raw files from my panasonic fz18

    Hi Everyone, I have been using aperture 3 for about a year and have no problems opening raw files from my nikon camera but I thought I would use my old panasonic FZ18 when I go kayaking just in case the camera gets wet. To my surprise when I downloaded my raw files into Aperture from my FZ18 they would not open. Is there a codec or program update that will enable Aperture to open my raw files.
    Thanks Colin

    The FZ18, FZ35 and later are not supported by Apple RAW processing mostly due to the exotic barrel distortion correction that needs to be applied for wide angle shots.  Even Adobe DNG converter will not convert the .RW2 files to DNG unless you use dngsanitize to remove the lens correction metadata.  You can then bring the DNG files into Aperture.
    -Steve

  • The problem i am having is when i go to open a file from the menu bar that as "FILE" is blackcolor

    the problem i am having is when i go to open a file from the menu bar that as "FILE" is all black in color and i cant see what i'm picking how do i change that so i can see what i'm picking

    Is that Photoshop?  Depending on the version you could try to change the Color Theme (Edit | Preferences | General | Appearance).
    If that does not help, you may have a better chance to get a useful answer if you ask in the Photoshop or Photoshop Elements forum.

  • PROBLEM while using URL in order to open a file from a servlet

    Hi,
    I am having a problem while trying to open a file from my servlet by using URL connection. Following is my code sample. what happens is when I first run my project it opens the file but after that when I rerun it again and again it sometimes opens it and sometimes not. if it can't open it it gives an error saying "the file is damaged and couldn't be repaired". I don't get any exceptions. if you guys can help me I will appreciate it so much... thanks.
    here is my code :
    URL url = new URL("http://demobcs.ibm.com:81/test.pdf");
    resp.setContentType(getContentType("http://demobcs.ibm.com:81/test.pdf"));
              ServletOutputStream sos = null;
              BufferedInputStream bis = null;
              try {
                   sos = resp.getOutputStream();
              } catch (Exception e) {
                   System.out.println("exception !!!!");
                   e.printStackTrace();
              System.out.println("burada2");
              try {
                   byte[] bytes = new byte[4096];
                   //bis = new BufferedInputStream(conn.getInputStream());
                   DataInputStream in = new DataInputStream(url.openStream());
                   //DataInputStream in = new DataInputStream(conn.getInputStream());
                   bis = new BufferedInputStream(in);
                   int j;
                   while ((j = bis.read(bytes, 0, 4096)) != -1) {
                        try {
                             sos.write(bytes, 0, 4096);
                             System.out.println("file is being read ...:");
                        } catch (Exception e) {
                             e.printStackTrace();
                   in.close();
                   bis.close();          
                   //sos.close();
              } catch (Exception e) {
                   System.out.println("exception :"+e.toString());
                   e.printStackTrace();
              }

    You are writing (<filesize> mod 4096) bytes of crap at the end of the file. Use your variable j instead for the number of bytes to write in your loop.

  • Can no longer open PDF files from my emails sent from other websites. Problem seems to correlate with automatic upgrade of free adobe software (from version 11 to Reader DC)?

    Can no longer open PDF files from my emails sent from other websites. Problem seems to correlate with automatic upgrade of free adobe software (from version 11 to Reader DC)?

    To configure the browser to use Acrobat or Adobe Reader to open PDF files:
    1. Quit Internet Explorer(any other browser)
    2. Start Acrobat or Adobe Reader.
    3. Choose Edit > Preferences.
    4. Select Internet in the list on the left.
    5. Deselect(Uncheck) Display PDF in Browser, and click OK.
    6. Restart Internet Explorer

Maybe you are looking for

  • Issue with parameter in my package

    Hi ! I have a problem and I don't know how resolve it ... and I don't know where searching an answer ... So my problem is that : I create a concurrent program with a parameter : p_type_edition (in lower case) I create a dataTemplate with the paramete

  • File transfer from old G4 iBook to new MacBook Pro

    I hope this is the right place for this post/question.... I am trying to do a file migration from my old iBook G4 PPC to my new MacBook Pro. The iBook does not have the migration utility and when I put the new OSX DVD in from my MacBook (as instructe

  • Hyperlink in pdf forms

    I want to provide a link as a static text while designing the xdp.Please help me for this. Any info. related to this is highly appreciated. Thanks in advance.

  • Can I control the Aria Player mixing panel in Logic?

    I am using Garritan Personal Orchestra in Logic 9 and would like to be able to control the volume sliders in the Aria player. But CC7, volume control, messages are only changing the Logic volume sliders. Anyone knows how to redirect this to the Aria

  • 3 beeps and no video

    Occasionally when starting my system (MSI KT6V-LSR, Barton 2600+, 512MB Kingston Valueram DDR400) I get 3 beeps and no video. Any ideas why?