FolderItem.GetLink プロパティ
本ページには広告が含まれています。
Shell.GetLinkを取得します。
- 構文
- ShellLinkObject = FolderItem.GetLink
- 引数
- 戻り値
- Shell.GetLink
FolderItem オブジェクトを返すメソッド・プロパティ
- Folder.ParseName メソッド
- 指定されたアイテムのFolderItem オブジェクトを作成して返します。
- FolderItems.Item メソッド
- コレクション内の指定されたアイテムのFolderItem オブジェクトを取得します。
- Folder2.Self プロパティ
- Folder2 オブジェクトのFolderItem オブジェクトを返します。
プログラム実行例
デスクトップにChromeのショートカットを作成
デスクトップにGoogle Chromeで[createLink url="https://google.co.jp" title="https://google.co.jp"]をシークレットモードで起動するショートカットを作成します。
CONST ssfDesktop = 0
DIM Shell = CREATEOLEOBJ("Shell.Application")
DIM FSO = CREATEOLEOBJ("Scripting.FileSystemObject")
DIM WshShell = CREATEOLEOBJ("WScript.Shell")
DIM Folder2 = Shell.NameSpace(ssfDesktop)
DIM path = Folder2.Self.Path + "\Chrome.lnk"
DIM WshShortcut = WshShell.CreateShortcut(path)
WITH WshShortcut
DIM chromePath = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
.Description = "Chromeをシークレットモードで起動します。"
.Hotkey = "Ctrl+Shift+C"
.IconLocation = chromePath + ",7"
.TargetPath = chromePath
.WindowStyle = 3
.Save
ENDWITH
Folder = Shell.NameSpace(FSO.GetParentFolderName(path))
DIM FolderItem = Folder.ParseName(FSO.GetFileName(path))
DIM ShellLinkObject = FolderItem.Getlink()
DIM Args[] = "--incognito", "https://google.co.jp"
WITH ShellLinkObject
.Arguments = JOIN(Args)
.Save
ENDWITH
結果

解説(自動生成)
- 1行目
- 定数ssfDesktopを定義し、0を割り当てます。
- 3行目
DIM Shell = CREATEOLEOBJ("Shell.Application")
変数Shellを宣言し、Shell オブジェクトを代入します。- 4行目
DIM FSO = CREATEOLEOBJ("Scripting.FileSystemObject")
変数FSOを宣言し、FileSystemObject オブジェクトを代入します。- 5行目
DIM WshShell = CREATEOLEOBJ("WScript.Shell")
変数WshShellを宣言し、WshShell オブジェクトを代入します。- 7行目
DIM Folder2 = Shell.NameSpace(ssfDesktop)
変数Folder2を宣言し、を表すFolder2 オブジェクトを代入します。- 8行目
DIM path = Folder2.Self.Path + "\Chrome.lnk"
変数pathを宣言し、Folder2 オブジェクトが示すFolderItem オブジェクト.Path + "\Chrome.lnk"を代入します。- 9行目
DIM WshShortcut = WshShell.CreateShortcut(path)
変数WshShortcutを宣言し、右辺の結果を代入します。- 11、19行目
WITH WshShortcut
…
ENDWITH
- 12行目
DIM chromePath = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
変数chromePathを宣言し、C:\Program Files (x86)\Google\Chrome\Application\chrome.exeを代入します。- 13行目
.Description = "Chromeをシークレットモードで起動します。"
- 14行目
.Hotkey = "Ctrl+Shift+C"
- 15行目
.IconLocation = chromePath + ",7"
- 16行目
.TargetPath = chromePath
- 17行目
- 18行目
- 21行目
Folder = Shell.NameSpace(FSO.GetParentFolderName(path))
- 22行目
DIM FolderItem = Folder.ParseName(FSO.GetFileName(path))
変数FolderItemを宣言し、右辺の結果を代入します。- 23行目
DIM ShellLinkObject = FolderItem.Getlink()
変数ShellLinkObjectを宣言し、右辺の結果を代入します。- 24行目
DIM Args[] = "--incognito", "https://google.co.jp"
変数Args[]を宣言し、右辺の結果を代入します。- 26、29行目
WITH ShellLinkObject
…
ENDWITH
- 27行目
.Arguments = JOIN(Args)
- 28行目