How to create shortcuts having two target

前端 未结 1 794
忘掉有多难
忘掉有多难 2020-12-11 12:13

I am creating a shortcut using the following script:

Set oShellLink = objShell.CreateShortcut(\"shortcut.lnk\")
oShellLink.TargetPath = \"C:\\Windows\\System         


        
相关标签:
1条回答
  • 2020-12-11 13:07

    When in doubt, read the documentation.

    From TargetPath property - Remarks Section
    This property is for the shortcut's target path only. Any arguments to the shortcut must be placed in the Argument's property.

    Arguments to a command belong in the Arguments property:

    Set oShellLink = objShell.CreateShortcut("shortcut.lnk")
    oShellLink.TargetPath = "C:\Windows\System32\mshta.exe"
    oShellLink.Arguments = "D:\path\to\file.hta"
    ...
    oShellLink.Save
    
    0 讨论(0)
提交回复
热议问题