-
java创建快捷方式
- package com.ts.util.ex.project;
-
- import net.jimmc.jshortcut.JShellLink;
-
- public class ShortCut {
-
-
- public static void main(String args[]) {
- String fileFolderPath = "D:\test\jshortcut-0_4.jar";
- String writeFolderPath = "D:\new";
- createShortCut(fileFolderPath, writeFolderPath);
- String path=getShortCutRealPath(writeFolderPath);
- System.out.println(path);
- }
-
-
- public static void createShortCut(String fileOrFolderPath,String writeShortCutPath) {
- JShellLink link = new JShellLink();
- writeShortCutPath.replaceAll("/", "\");
- String folder = writeShortCutPath.substring(0, writeShortCutPath.lastIndexOf("\"));
- String name = writeShortCutPath.substring(writeShortCutPath.lastIndexOf("\") + 1, writeShortCutPath.length());
- link.setName(name);
- link.setFolder(folder);
- link.setPath(fileOrFolderPath);
- link.save();
- }
-
-
- public static String getShortCutRealPath(String fileFolderPath) {
-
- fileFolderPath.replaceAll("/", "\");
- String folder = fileFolderPath.substring(0, fileFolderPath.lastIndexOf("\"));
- String name = fileFolderPath.substring(fileFolderPath.lastIndexOf("\") + 1, fileFolderPath.length());
- JShellLink link = new JShellLink(folder, name);
- link.load();
- return link.getPath();
- }
- }
-
相关阅读:
[转]为iPhone4S和iOS5增加全局英汉词典教程
Notes on MSBuild
Using jQuery To Manipulate and Filter Data
使用MSBuild进行自动化构建
使用ADO.NET的计算列
来自Twitter的前端工具包——Bootstrap
Jquery Templetes简介
C#导入导出Excel
Mysql在sql中截取时间类型字段的年月日和时间
使用NPOI导出Excel,并在Excel指定单元格插入图片
-
原文地址:https://www.cnblogs.com/Logic09/p/4062588.html
Copyright © 2020-2023
润新知