如何開啟和編輯windows.lnk快捷方式檔案?

雖然大多數人永遠不需要開啟.lnk檔案來編輯它,但在少數情況下可能需要或需要它。但是如何開啟和編輯快捷方式檔案呢?今天的超級使用者問答有答案。...

如何開啟和編輯windows.lnk快捷方式檔案?

雖然大多數人永遠不需要開啟.lnk檔案來編輯它,但在少數情況下可能需要或需要它。但是如何開啟和編輯快捷方式檔案呢?今天的超級使用者問答有答案。

今天的問答環節是由SuperUser提供的,SuperUser是Stack Exchange的一個分支,是一個由社群驅動的問答網站分組。

問題

超級使用者讀者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.

No matter what I try, my applicati*** 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?

有沒有辦法讓Jez開啟.lnk檔案並編輯它們?

答案

超級使用者貢獻者和31415、朱利安·奈特和維納亞克為我們提供了答案。首先,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:\Folder\containing\the\shortcut” 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.

接下來是朱利安·奈特的回答:

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:

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\to\new\exe.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!

最後,維納亞克的回答是:

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”.

有什麼要補充的解釋嗎?在評論中發出聲音。想從其他精通技術的Stack Exchange使用者那裡瞭解更多答案嗎?在這裡檢視完整的討論主題。

  • 發表於 2021-04-11 08:55
  • 閱讀 ( 49 )
  • 分類:網際網路

你可能感興趣的文章

4種方式開源軟體不夠好

... 方法3:右鍵單擊(僅限windows) ...

  • 發佈於 2021-03-12 12:02
  • 閲讀 ( 51 )

如何免費線上編輯PDF

adobeacrobat是一個相當強大的PDF瀏覽器,具有強大的編輯功能。但是,如果你不能訪問付費版本的程式,有一個簡單的線上解決辦法來編輯PDF。 ...

  • 發佈於 2021-03-12 13:47
  • 閲讀 ( 51 )

如何在adobe photoshop中新增和編輯文字

... 因此,在本文中,我們將向您展示如何在Photoshop中新增和編輯文字。這比你想象的要容易。 ...

  • 發佈於 2021-03-13 23:16
  • 閲讀 ( 58 )

為mac使用者提供7個省時的開啟和儲存對話方塊提示

... 每次我想在開啟一個檔案之前預覽它,我都會導航到它在Finder中的位置,以使用快速查詢功能。我從來沒有想過,我可以預覽檔案,因為我開啟他們,即從開啟對話方塊。事後看來,...

  • 發佈於 2021-03-15 01:13
  • 閲讀 ( 39 )

如何線上檢視和編輯photoshop psd檔案

如果你在旅途中,使用別人的電腦,或者你的電腦上沒有Photoshop或GIMP,那麼PSD檔案就沒什麼用了。幸運的是,一些線上工具使編輯PSD檔案成為可能,而不需要手頭上的常用工具。 ...

  • 發佈於 2021-03-15 06:12
  • 閲讀 ( 46 )

什麼是人工智慧檔案?如何開啟它沒有adobe illustrator

... 在Windows中,您需要將AI副檔名更改為PDF。突出顯示檔案並按鍵盤上的F2鍵。在檔名末尾新增PDF,並在出現提示時確認更改。現在,雙擊該檔案,它將在預設的PDF檢視器中開啟...

  • 發佈於 2021-03-17 22:39
  • 閲讀 ( 53 )

如何使用ms-paint編輯和增強螢幕截圖

... 在windows上截圖的基礎知識 ...

  • 發佈於 2021-03-19 05:34
  • 閲讀 ( 46 )

如何使用adobe premiere將影片剪輯成片段

...eprimiere的許可權,或者覺得這個程式太過龐大,你可以在Windows、Mac和Linux上使用免費軟體將較長的影片分割成較短的片段。當然,使用adobepremiere元素有很多理由,它是adobepremiere的縮小版。 ...

  • 發佈於 2021-03-24 20:32
  • 閲讀 ( 54 )

你不知道谷歌文件能做的10件事

...hift+S(如果您使用的是Mac)或Ctrl+Shift+S(如果您使用的是Windows PC)開始錄音。 ...

  • 發佈於 2021-03-26 17:03
  • 閲讀 ( 53 )

4種在windows上訪問和編輯iphone apple筆記的簡便方法

...記下資訊。然而,與其他許多蘋果應用程式一樣,它沒有Windows版本。因此,儘管在Windows電腦**問Apple Notes看起來像是一件家務事,但這很簡單。 ...

  • 發佈於 2021-03-28 01:39
  • 閲讀 ( 64 )
bcxgmnuqfr
bcxgmnuqfr

0 篇文章

作家榜

  1. admin 0 文章
  2. 孫小欽 0 文章
  3. JVhby0 0 文章
  4. fvpvzrr 0 文章
  5. 0sus8kksc 0 文章
  6. zsfn1903 0 文章
  7. w91395898 0 文章
  8. SuperQueen123 0 文章

相關推薦