pub fn read_path_from_lnk<P: AsRef<Path>>(
lnk_path: P,
encoding: Encoding,
) -> Result<PathBuf>Expand description
Open and parse a shell link
All string which are stored in the lnk file are encoded with either
Unicode (UTF-16LE) of any of the Windows code pages. Which of both is
being used is specified by the [LinkFlags::IS_UNICODE] flag. Microsoft
documents this as follows:
If this bit is set, the StringData section contains Unicode-encoded strings; otherwise, it contains strings that are encoded using the system default code page.
The system default code page is stored in
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage\ACP
Because we do not know what the system default code page was, you must
specify this using the encoding parameter (see below). If you you do
not know the system default code page either, you’re lost. There is no
way to correctly guess the used code page from the data in the lnk
file.
path- path of thelnkfile to be analyzedencoding- character encoding to be used if thelnkfile is not Unicode encoded