質問: linuxでwindows * .lnkショートカットから情報をダンプするにはどうすればよいですか? linuxでwindows lnkショートカットを起動するには、wine start qqq.lnk。しかし、それに関する情報(コマンドライン、現在のディレクトリ)を表示しますか? stringsでは不十分です。
回答: lnkinfoツールは liblnk (debianのliblnk-utilsパッケージ)から使用できます。lnkinfo <file.lnk> スクリプトでの使用例:local_path=$(lnkinfo "$1" | grep 'local path' | cut -d':' -f2-) args=$(lnkinfo "$1" | grep 'command line arguments' | cut -d':' -f2-) 出力例:$ lnkinfo 'program files - shortcut.lnk' lnkinfo 20171101 windows shortcut information: contains a link target identifier contains a relative path string link information: creation time : jul 14, 2009 03:20:08.555426400 utc modification time : apr 23, 2019 21:36:46.017274100 utc access time : apr 23, 2019 21:36:46.017274100 utc file size : 12288 bytes icon index : 0 show window value : 0x00003000 hot key value : 12288 file attribute flags : 0x00000011 is read-only (file_attribute_read_only) is directory (file_attribute_directory) drive type : fixed (3) drive serial number : 0x0e1909c6 volume label : local disk local path : c:\program files relative path : ..\..\..\program files link target identifier: shell item list number of items : 3 shell item: 1 item type : root folder class type indicator : 0x1f (root folder) shell folder identifier : 20d04fe0-3aea-1069-a2d8-08002b30309d shell folder name : my computer shell item: 2 item type : volume class type indicator : 0x2f (volume) volume name : c:\ shell item: 3 item type : file entry class type indicator : 0x31 (file entry: directory) name : progra~1 modification time : apr 23, 2019 21:36:48 file attribute flags : 0x00000011 is read-only (file_attribute_read_only) is directory (file_attribute_directory) extension block: 1 signature : 0xbeef0004 (file entry extension) long name : program files localized name : @shell32.dll,-21781 creation time : jul 14, 2009 03:20:10 access time : apr 23, 2019 21:36:48 ntfs file reference : mft entry: 878, sequence: 1 distributed link tracking data: machine identifier : <snip> droid volume identifier : b2638d5e-f5b8-480c-bda0-fdb25ab91131 droid file identifier : 968b84a2-a646-11e9-a124-0021cc6948e3 birth droid volume identifier : b2638d5e-f5b8-480c-bda0-fdb25ab91131 birth droid file identifier : 968b84a2-a646-11e9-a124-0021cc6948e3