raf raf - 1 year ago 91
Bash Question

execute file .lnk in Java

i need to execute a .lnk file in java (lnk file that points at an exe file). how can i do?

in vb .net i do


and it works

thx you for help.

Answer Source

Use a ProcessBuilder:

ProcessBuilder pb = new ProcessBuilder("cmd", "/c", "C:\\temp\\file.lnk");
Process process = pb.start();

Call process.getInputStream() and process.getErrorStream() to read the output and error output of the process.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download