什么是Windows快捷方式的内部结构? [英] What is the internal structure of a Windows shortcut?

查看:235
本文介绍了什么是Windows快捷方式的内部结构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一台计算机上安装3个硬盘:使用Windows XP安装2个,使用Windows 7安装1个,依次从每个计算机加载操作系统。



我发现有些工作快捷方式(不是全部)在第一个XP中创建的不能在第二个XP和Windows 7中工作(不可用于查看快捷方式的对象)。



要理解为什么它是不工作我在windows 7中创建了相同的快捷方式,并在十六进制编辑器中打开这些shorcut的两个文件。



我发现它的结构是不同的,但我不知道如何比较它。



什么是Windows快捷方式的内部结构?



什么开始和结束字节一些有用的快捷方式内容块?

解决方案

快捷方式( .lnk )文件格式是Ms属性,可以在此处看到。



但是,为了避免读取它整个PDF,一个存储在快捷方式中的东西(可以通过使用十六进制查看器查看快捷方式来检查)是它所引用的(完整)目标路径(!!重要:在其创建时);所以它是 DriveLetter \ the_full_path



为了消除混淆,我建议使用快捷键因此,当切换硬盘时( DriveLetter s - aka C:

code>指向不同的东西)假设你在其中一个上创建了一个快捷方式: C:\shortcut.lnk C :是分配给Windows启动的HDD的 DriveLetter ,我们称之为HDD1),它指向位于另一个HDD(和分区,我们称之为HDD2)的目标文件。 (例如 E:\target.txt );当您切换硬盘(制作HDD2主启动盘)时, DriveLetter 也会发生变化,现在HDD2将变为 C:和HDD1 d 。在推出HDD3等时,情况会更复杂。



作为对我们问题的回答: .lnk 文件不要不工作,因为他们的目标不再存在。

3 HDD in one computer: 2 with Windows XP, 1 with Windows 7, sequentially load the operating system from each of them.

I discover that some working shortcuts (not all) which created in first XP don't work in second XP and Windows 7 (not available for viewing the object for the shortcut).

To understand why it's don't work I create the same shortcut in windows 7 and open both files of these shorcuts in hex editor.

I discover that it's structures is diffrent but I do not know how to compare it.

What is the internal structure of a Windows shortcut?

What start and end bytes of some usefull blocks of shortcut's content?

解决方案

The shortcut (.lnk) file format is Ms property and can be seen here.

However, to spare you from reading that whole PDF, one thing that is stored within a shortcut for sure (can be checked by "looking" at the shortcut using a hex viewer) is the (full) target path that it references (!!important: at the time of its creation); so it's DriveLetter:\the_full_path.

To clear up confusion, I'd suggest playing with shortcuts that have targets on the same drive.

So, when switching HDDs (the DriveLetters - aka C: point to different things) let's say that you created on one of them a shortcut: C:\shortcut.lnk (C: is the DriveLetter assigned to the HDD where Windows booted from, let's call this HDD1) which points to target file located on another HDD(and partition, let's call this HDD2) (e.g. E:\target.txt); when you'll switch HDDs (making HDD2 primary boot disk) the DriveLetters will change too so now HDD2 will be C: and HDD1 D:. Things complicate more when introducing HDD3 and so on.

As an answer to our question: the .lnk files don't work because their target is no longer present.

这篇关于什么是Windows快捷方式的内部结构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆