Làm thế nào bạn có thể mở và chỉnh sửa Windows .lnk Shortcut Files?

Mục lục:

Làm thế nào bạn có thể mở và chỉnh sửa Windows .lnk Shortcut Files?
Làm thế nào bạn có thể mở và chỉnh sửa Windows .lnk Shortcut Files?

Video: Làm thế nào bạn có thể mở và chỉnh sửa Windows .lnk Shortcut Files?

Video: Làm thế nào bạn có thể mở và chỉnh sửa Windows .lnk Shortcut Files?
Video: Android kém bảo mật??? Những "hiểu sai" về Android mà bạn đang gặp phải! - YouTube 2024, Có thể
Anonim
Trong khi hầu hết mọi người sẽ không bao giờ cần phải mở một tập tin.lnk để chỉnh sửa nó, có thể có những dịp hiếm hoi khi nó là cần thiết hoặc mong muốn. Nhưng làm cách nào để bạn mở và chỉnh sửa tệp lối tắt? Bài đăng Hỏi & Đáp của SuperUser hôm nay có câu trả lời.
Trong khi hầu hết mọi người sẽ không bao giờ cần phải mở một tập tin.lnk để chỉnh sửa nó, có thể có những dịp hiếm hoi khi nó là cần thiết hoặc mong muốn. Nhưng làm cách nào để bạn mở và chỉnh sửa tệp lối tắt? Bài đăng Hỏi & Đáp của SuperUser hôm nay có câu trả lời.

Phiên Hỏi & Đáp hôm nay đến với chúng tôi theo lịch sự của SuperUser - một phân khu của Stack Exchange, một nhóm các trang web Hỏi & Đáp do cộng đồng điều hành.

Câu hỏi

Người đọc siêu người dùng Jez muốn biết cách mở các tệp.lnk để xem ‘nội dung’ và chỉnh sửa chúng nếu cần:

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.

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?

Có cách nào để Jez thực sự mở các tệp.lnk và chỉnh sửa chúng không?

Câu trả lời

Những người đóng góp của SuperUser và31415, Julian Knight và Vinayak có câu trả lời cho chúng tôi. Đầu tiên, và31415:

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

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

cd /d “X:Foldercontaining heshortcut” ren “some shortcut.lnk” “some 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.

Tiếp theo là câu trả lời từ 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.

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

  • lnk-parser
  • LnkEditorGUI
  • lnkedit

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):

  • Copy-Item $sourcepath $destination ## Get the lnk we want to use as a template $shell = New-Object -COM WScript.Shell $shortcut = $shell.CreateShortcut($destination) ## Open the lnk $shortcut.TargetPath = “C:path o
  • ewexe.exe” ## Make changes $shortcut.Description = “Our new link” ## This is the “Comment” field $shortcut.Save() ## Save

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

Và cuối cùng, câu trả lời từ Vinayak:

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

Opening.lnk files in Notepad:

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.

Opening.lnk files in HxD Hex Editor:

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

Opening.lnk files using the command prompt:

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

Opening.lnk files in just about any program:

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

Có cái gì để thêm vào lời giải thích? Tắt âm thanh trong các ý kiến. Bạn muốn đọc thêm câu trả lời từ những người dùng Stack Exchange có hiểu biết công nghệ khác? Xem toàn bộ chuỗi thảo luận tại đây.

Đề xuất: