2014-04-02 32 views
1

如何刪除快捷方式文件。可能是因爲我沒有放置擴展名文件。我試圖用它可以刪除的txt文件。但有了捷徑,它沒有。劑量快捷方式有任何特殊的擴展名?使用Java文件方法刪除Jar快捷方式

File file = new File("C://app"); //app is the shortcut 
file.delete(); // when the code is executed the app shortcut file did not deleted.. 

解決方案

File file = new File("C://app.lnk"); //add .lnk (window shortcut extension) 
file.delete(); //now can delete shortcut 
+0

確定現在我找到了解決辦法,我要補充的.lnk擴展快捷方式文件 –

+1

回答自己的問題,並把它標記爲回答則 – rpg711

+1

我寧願建議刪除的問題,如果你是罰款不存儲在SO存儲庫中供將來參考,因爲不會出現需要 – spiderman

回答

0

我們只需要如下把.LNK擴展到文件中。

File file = new File("C://app.lnk"); //add .lnk (window shortcut extension) 
file.delete(); //now can delete shortcut