dwg.lnk文件怎么打开_如何打开和编辑Windows .lnk快捷文件?

dwg.lnk文件怎么打开_如何打开和编辑Windows .lnk快捷文件?

dwg.lnk文件怎么打开

dwg.lnk文件怎么打开_如何打开和编辑Windows .lnk快捷文件?

While most people will never need to open a .lnk file to edit it, there may be rare occasions when it is necessary or desired. But how do you open and edit a shortcut file? Today’s SuperUser Q&A post has the answers.

尽管大多数人永远都不需要打开.lnk文件来进行编辑,但是在少数情况下,有必要或需要它。 但是,如何打开和编辑快捷方式文件? 今天的“超级用户问答”帖子已经给出了答案。

Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.

今天的“问答”环节由SuperUser提供,它是Stack Exchange的一个分支,该社区是由社区驱动的Q&A网站分组。

问题 (The Question)

SuperUser reader Jez wants to know how to open .lnk files to view the ‘contents’ and edit them if needed:

超级用户阅读器Jez想知道如何打开.lnk文件以查看“内容”并根据需要进行编辑:

A .lnk file in Windows is an actual file intended to be a shortcut to another file, but I really do want to view the contents of the .lnk file itself. However, I am finding it literally impossible to do so.

Windows中的.lnk文件是实际的文件,旨在作为另一个文件的快捷方式,但我确实希望查看.lnk文件本身的内容。 但是,我发现这样做实际上是不可能的。

No matter what I try, my applications are opening the contents of the file it points to (drag and drop into a text or hex editor, File –> Open from a text or hex editor, etc.).

无论我尝试什么,我的应用程序都将打开它指向的文件的内容(拖放到文本或十六进制编辑器中,“文件”->从文本或十六进制编辑器中打开,等等)。

Is there any way I can get a program to actually open the .lnk file itself instead of the file it points to?

有什么方法可以使我自己打开.lnk文件而不是它指向的文件?

Is there a way for Jez to actually open .lnk files and edit them?

Jez是否可以实际打开.lnk文件并对其进行编辑?

答案 (The Answer)

SuperUser contributors and31415, Julian Knight, and Vinayak have the answer for us. First up, and31415:

超级用户贡献者and31415,Julian Knight和Vinayak为我们找到了答案。 首先,31415:

Using HxD Hex Editor, you can open .lnk files just fine, as long as you do not drag and drop them.

使用HxD Hex Editor ,只要不拖放它们,就可以很好地打开.lnk文件。

As a workaround, open a command prompt and rename the .lnk file with a different, non-existent extension such as .lne:

解决方法是,打开命令提示符,然后使用其他不存在的扩展名(例如.lne)重命名.lnk文件:

  • cd /d “X:\Folder\containing\the\shortcut”

    cd / d“ X:\文件夹\包含\ the \快捷方式”

    ren “some shortcut.lnk” “some shortcut.lne”

    任“一些shortcut.lnk”“一些shortcut.lne”

You will then be able to treat the shortcut just like a regular file. When you are done, make sure to rename the file with the original .lnk extension to restore its usual functionality.

然后,您将能够像对待普通文件一样对待快捷方式。 完成后,请确保使用原始的.lnk扩展名重命名该文件,以恢复其通常的功能。

Followed by the answer from Julian Knight:

随后是朱利安·奈特(Julian Knight)的回答:

The whole point of a .lnk file is for Windows to treat it as a link to another file, so it should be hard to edit! Perhaps it would help if you described why you want to edit it. You can change the settings of a .lnk file by right-clicking and choosing Properties.

.lnk文件的全部要点是Windows会将其视为到另一个文件的链接,因此应该很难编辑! 如果您描述了为什么要对其进行编辑,也许会有所帮助。 您可以通过右键单击并选择属性来更改.lnk文件的设置。

If you really want to edit it, you need a special tool. There are a few of these around including:

如果您确实要编辑它,则需要一个特殊的工具。 其中包括以下几种:

I have not tried any of these, just Googled them.

我没有尝试过这些方法,只是谷歌搜索了它们。

You can also edit the properties via PowerShell (from this previous answer on Stack Overflow):

您还可以通过PowerShell编辑属性( 来自Stack Overflow的上一个答案 ):

  • Copy-Item $sourcepath $destination  ## Get the lnk we want to use as a template

    复制项目$ sourcepath $目的地##获取我们要用作模板的lnk

    $shell = New-Object -COM WScript.Shell

    $ shell =新对象-COM WScript.Shell

    $shortcut = $shell.CreateShortcut($destination)  ## Open the lnk

    $ shortcut = $ shell.CreateShortcut($ destination)##打开lnk

    $shortcut.TargetPath = “C:\path\to\new\exe.exe”  ## Make changes

    $ shortcut.TargetPath =“ C:\ path \ to \ new \ exe.exe” ##进行更改

    $shortcut.Description = “Our new link”  ## This is the “Comment” field

    $ shortcut.Description =“我们的新链接” ##这是“评论”字段

    $shortcut.Save()  ## Save

    $ shortcut.Save()##保存

Since this uses the Shell COM object, you could also do this with WSH or even VBA in Office!

由于它使用Shell COM对象,因此您也可以在Office中使用WSH甚至VBA来执行此操作!

And finally, the answer from Vinayak:

最后,Vinayak的回答是:

I have tried this and it works for me on Windows 8.1:

我已经尝试过了,它在Windows 8.1上对我有效:

Opening .lnk files in Notepad:

在记事本中打开.lnk文件:

  • Just drag and drop them into the Notepad window. If you open them via the Open dialog, Notepad will open the exe file pointed to by the .lnk file.

    只需将它们拖放到“记事本”窗口中即可。 如果通过“打开”对话框打开它们,记事本将打开.lnk文件指向的exe文件。

Opening .lnk files in HxD Hex Editor:

HxD Hex Editor中打开.lnk文件:

  • Open them as you would any file using the Open dialog (File –> Open).

    使用“打开”对话框(文件->打开)打开它们,就像打开任何文件一样。

Opening .lnk files using the command prompt:

使用命令提示符打开.lnk文件:

  • Navigate to the folder containing the .lnk files and type the command: “TYPE SHORTCUTNAME.LNK”.

    导航到包含.lnk文件的文件夹,然后键入命令:“ TYPE SHORTCUTNAME.LNK”。

Opening .lnk files in just about any program:

在几乎所有程序中打开.lnk文件:

  • Start the command prompt, navigate to the folder where the program is located, use the command: PROGRAM_NAME.EXE “path to LNK file”.

    启动命令提示符,导航到程序所在的文件夹,使用命令:PROGRAM_NAME.EXE“ LNK文件的路径”。


Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.

有什么补充说明吗? 在评论中听起来不错。 是否想从其他精通Stack Exchange的用户那里获得更多答案? 在此处查看完整的讨论线程

翻译自: https://www.howtogeek.com/190897/how-can-you-open-and-edit-windows-.lnk-shortcut-files/

dwg.lnk文件怎么打开