0

This is my coding and it will create Decrypted image.jpg in desktop directory

File desktopDir = new File(System.getProperty("user.home"), "Desktop");
System.out.println(desktopDir.getPath() + " " + desktopDir.exists());
String pathToDesktop = desktopDir.getPath();
FileOutputStream outStream =  new FileOutputStream(new File(desktopDir, "Decrypted image.jpg"));

and how to call that file "Decrypted image.jpg" in

Runtime.getRuntime().exec("rundll32 url.dll, FileProtocolHandler " + "Decrypted image.jpg");

how to change code up there so that can run and show the image ? sorry for bad english.

Alex K.
  • 171,639
  • 30
  • 264
  • 288
John U2
  • 3
  • 4
  • See also [When Runtime.exec() won't](http://www.javaworld.com/article/2071275/core-java/when-runtime-exec---won-t.html) for many good tips on creating and handling a process correctly. Then ignore it refers to `exec` and use a `ProcessBuilder` to create the process. .. Then break the `String arg` into a `String[] args` to account for may little quirks in parsing arguments. – Andrew Thompson May 08 '16 at 04:34
  • @Andrew Thompson I don't get it. I'm new and still noob in java. Can you show the code ?? thanks in advance – John U2 May 08 '16 at 09:17
  • 1
    *"Can you show the code ??"* Don't ask for code. SO is not a code generation machine or a help-desk. BTW - what is all this supposed to achieve? Showing an image on-screen? If so, use `Desktop.getDesktop().open(File)` - much easier.. – Andrew Thompson May 08 '16 at 10:13

0 Answers0