欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Windows 腳本宿主  

CreateShortcut 方法

創(chuàng)建新的快捷方式,或打開(kāi)現(xiàn)有的快捷方式。

object.CreateShortcut(strPathname) 

參數(shù)

object
WshShell 對(duì)象。
strPathname
表示要?jiǎng)?chuàng)建的快捷方式的路徑名的字符串值。

說(shuō)明

CreateShortcut 方法返回 WshShortcut 對(duì)象或 WshURLShortcut 對(duì)象。只調(diào)用 CreateShortcut 方法并不會(huì)導(dǎo)致快捷方式的創(chuàng)建?旖莘绞綄(duì)象以及對(duì)其所做的更改存儲(chǔ)在內(nèi)存中,直到您用 Save 方法將其保存到磁盤(pán)中為止。要?jiǎng)?chuàng)建快捷方式,必須執(zhí)行以下操作:

  1. 創(chuàng)建 WshShortcut 對(duì)象的實(shí)例。
  2. 初始化它的屬性。
  3. 用 Save 方法將其保存到磁盤(pán)中。
    注意   一個(gè)常見(jiàn)的問(wèn)題是,將參數(shù)放在快捷方式對(duì)象的 TargetPath 屬性中將不起作用?旖莘绞降乃袇(shù)都必須放在 Arguments 屬性中。

示例

下面的示例創(chuàng)建 WshShell 對(duì)象并使用 CreateShortcut 方法創(chuàng)建兩個(gè)快捷方式。

<package>
   <job id="vbs">
      <script language="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
         set oUrlLink = WshShell.CreateShortcut(strDesktop & "\Microsoft Web Site.url")
         oUrlLink.TargetPath = "http://www.microsoft.com/china"
         oUrlLink.Save
      </script>
   </job>

   <job id="js">
      <script language="JScript">
         var WshShell = WScript.CreateObject("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();
         var oUrlLink = WshShell.CreateShortcut(strDesktop + "\\Microsoft Web Site.url");
         oUrlLink.TargetPath = "http://www.microsoft.com/china";
         oUrlLink.Save();
      </script>
   </job>
</package>

請(qǐng)參閱

運(yùn)行腳本 | WshShortcut 對(duì)象 | WshUrlShortcut 對(duì)象 | WshShell 對(duì)象