FullName プロパティ (WshShortcut オブジェクト)

ショートカット オブジェクトのリンク先への絶対パスを返します。

object.FullName 

引数

  • object
    WshShortcut オブジェクトです。

解説

FullName プロパティには、ショートカットのリンク先への絶対パスを示す読み取り専用の文字列値が格納されます。

使用例

次のコードは、ショートカットへの絶対パスを取得する例です。

VBScript

set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
set oShellLink = WshShell.CreateShortcut(strDesktop & "\Shortcut Script.lnk")
oShellLink.TargetPath = WScript.ScriptFullName
oShellLink.WindowStyle = 1
oShellLink.Hotkey = "CTRL+SHIFT+F"
oShellLink.IconLocation = "notepad.exe, 0"
oShellLink.Description = "Shortcut Script"
oShellLink.WorkingDirectory = strDesktop
oShellLink.Save
WScript.Echo oShellLink.FullName

JScript

var WshShell = new ActiveXObject("WScript.Shell");
strDesktop = WshShell.SpecialFolders("Desktop");
var oShellLink = WshShell.CreateShortcut(strDesktop + "\\Shortcut Script.lnk");
oShellLink.TargetPath = WScript.ScriptFullName;
oShellLink.WindowStyle = 1;
oShellLink.Hotkey = "CTRL+SHIFT+F";
oShellLink.IconLocation = "notepad.exe, 0";
oShellLink.Description = "Shortcut Script";
oShellLink.WorkingDirectory = strDesktop;
oShellLink.Save();
WScript.Echo(oShellLink.FullName);

参照

Path プロパティ | WScript オブジェクト | WshShortcut オブジェクト | WshUrlShortcut オブジェクト