java调用windows命令行

    技术2022-05-19  21

    public static void main(String[] args) { Runtime rt = Runtime.getRuntime(); try { String file = "d://exiftool.exe -Comment=/"同日下午/" d://t.jpg"; rt.exec("cmd.exe /c " + file); } catch (IOException e) { e.printStackTrace(); } }

    d://exiftool.exe -Comment=/"同日下午/" d://t.jpg

    调用d盘的exiftool.exe工具,来修改d盘下的图片t.jpg的备注

    exiftool:读写图片的exif和iptc的命令行工具

     

    cmd.exe /c

    执行完成后即可关闭


    最新回复(0)