Start Win Explorer with folder

hello all,

how can I start Win explorer with explorer?

I read this: Parameter des Windows Explorers "explorer.exe" - Windows FAQ

but this doesn’t work

    launch ( "explorer.exe"+
      " /n," +
      sketchPath("")+""+pathFolder+"\\"   );

OR

try
    {
      ProcessBuilder pb = new ProcessBuilder("explorer", " ", "/n,", sketchPath("")+""+pathFolder+"\\");
      Process p = pb.start();
    }
    catch ( Exception e )   // IOException, URISyntaxException
    {
      e.printStackTrace();
    }//catch

Hello @chrisir,

Reference:
https://ss64.com/nt/explorer.html

Example:

This will open sketch folder:

launch ("explorer.exe" + 
        ' ' +
        '"' +
        sketchPath("") +
        '"');

:)

2 Likes

That worked! Thanks a lot!

These all work as well:

// https://processing.org/reference/String.html
// https://processing.org/reference/launch_.html
// https://ss64.com/nt/explorer.html

//**********************************************  

launch ("explorer.exe" + 
        "/n," +              //No spaces!
        sketchPath(""));
 
//**********************************************        
        
String s = "explorer.exe" + 
        "/n," +              //No spaces!
        sketchPath("");
        
println(s);        
launch(s);

//********************************************** 

String sp = sketchPath("");
String args [] = {"explorer.exe", "/n,", sp};
launch(args);

:)

1 Like