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

Windows 腳本宿主  

CreateShortcut 方法

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

object.CreateShortcut(strPathname) 

參數

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

說明

CreateShortcut 方法返回 WshShortcut 對象或 WshURLShortcut 對象。只調用 CreateShortcut 方法并不會導致快捷方式的創(chuàng)建?旖莘绞綄ο笠约皩ζ渌龅母拇鎯υ趦却嬷,直到您用 Save 方法將其保存到磁盤中為止。要創(chuàng)建快捷方式,必須執(zhí)行以下操作:

  1. 創(chuàng)建 WshShortcut 對象的實例。
  2. 初始化它的屬性。
  3. 用 Save 方法將其保存到磁盤中。
    注意   一個常見的問題是,將參數放在快捷方式對象的 TargetPath 屬性中將不起作用?旖莘绞降乃袇刀急仨毞旁 Arguments 屬性中。

示例

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

<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>

請參閱

運行腳本 | WshShortcut 對象 | WshUrlShortcut 對象 | WshShell 對象