1.11M Members

How to create shortcut to windows application (*.ink) in Java?

 
0
 

Hi everyone,

I used to create shortcuts with IWshRuntimeLibrary in C#, but now i am trying to create in java, which i couldn't found via googling.

Can anyone show me the shortcut path of wisdom and illumination? :)

 
0
 

Use the ProcessBuilder class to run the (free) XXMKLINK program?

 
0
 

Use the ProcessBuilder class to run the (free) XXMKLINK program?

Thanks James,

Even though, i don't want to use an external executable file to process, i guess this is the best alternative for now (with running in quiet mode "/q")...

 
0
 

try this

String script = "Set sh = CreateObject(\"WScript.Shell\")"
+ "\nSet shortcut = sh.CreateShortcut(\"D:/temp/Shortcut.lnk\")"
+ "\nshortcut.TargetPath = \"D:/some path to file\""
+ "\nshortcut.Save";

File file = new File("d:/temp/temp.vbs");
FileOutputStream fo = new FileOutputStream(file);
fo.write(script.getBytes());
fo.close();
//Runtime.getRuntime().exec("wscript.exe D:/temp/crear-acceso-directo.vbs");
Runtime.getRuntime().exec("wscript.exe " + file.getAbsolutePath() );

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article