4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ショートカットの内容を取得する

Posted at

やりたいこと

ショートカットのリンク先情報などをコマンドで取得したい!

実現方法

Windows PowerShell使います。

フィルタを作成する

filter Get-Shortcut()
{
    $shell  = new-object -comobject WScript.Shell
    return $shell.CreateShortcut($_)
}

コマンド実行

ショートカット名とリンク先のフルパスを取得

dir -r -include "*.lnk" | Get-Shortcut | Select-Object -property Fullname,TargetPath

引数を取得

dir -r -include "*.lnk" | Get-Shortcut | Select-Object -property Fullname,Arguments
4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?