Cannot open .exe files

edited February 2017 in How To...

Hello guys, i was working on my project when suddenly the following problem occured: I want to launch another (exported) processing file (.exe) and i can't manage to do it with neither launch () nor exec().

String a = "C:\\Users\\Niki\\Documents\\Processing\\ShapesDemo\\application.windows64\\ShapesDemo.exe"; launch(b);

I have tried different ways of writing it, such as String a[] = {"..."}, different slashes and so on. It opens pretty much everything but .exe files.

I would be really glad if I understand what's going wrong here. Cheers!

Tagged:

Answers

  • I'm on Windows 7, his solution with the slashes didn't work here ;/

  • So far the solution with creating the bat file. In the release notes of Processing 3.2.4 they said they updated the documentation for exec() but no where to be found or not noticeable changes.

    Kf

  • edited February 2017

    You might try something like this:

    void setup () {
      size (175, 150);
    }
    
    void draw() {
    }
    
    
    void mouseClicked() {
      //exec("c:/Windows/notepad.exe");    // this works
      //launch("c:/Windows/notepad.exe");  // this works
    
      //this works for compiled (exported) processing sketches
      PrintWriter output=null;
      output = createWriter("myfile.bat");
      output.println("cd C:\\Users\\Niki\\Documents\\Processing\\ShapesDemo\\application.windows64\\");
      output.println("ShapesDemo.exe");
      output.flush();
      output.close();  
      output=null;
      launch(sketchPath("")+"myfile.bat");
    }
    
  • And now even complex .bat files don't run, only the most basic ones.

  • Thanks for the help, guys! Appreciate it

  • If this worked ok you can mark your post as answered.

Sign In or Register to comment.