本ページには広告が含まれています。
			
						
			
				
				
ショートカットの作成、読み込み、および編集に使用されます。WshShortcutオブジェクトは、ショートカットのプロパティを設定および取得するために使用できるプロパティを提供します。WshShortcutオブジェクトは、WshShellオブジェクトのCreateShortcutメソッドを使用して作成されます。
メソッド
<表示切り替え>プロパティ
<表示切り替え>- IconLocation
- ショートカットが参照するアイコンのファイルパスとインデックスを取得または設定するために使用されます。
WshShortcut オブジェクト を返すメソッド・プロパティ
- WshShell.CreateShortcut メソッド
- ショートカットまたはURLショートカットへのオブジェクト参照を作成します。
プログラム実行例
デスクトップに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結果

使用関数
