<?xml version="1.0"?>
<?job error="true" debug="false"?>
<package id="CreateShortCut">
<job id="Main">
<runtime>
<description>
FileName: CreateShortCut.wsf
This Script create shortcut as your wish.
Version: 1.5
Created by icuc88@hotmail.com
Last Modify: Feb 13th, 2004
All right reserved.
</description>
<named
name="SF"
helpstring="The special folder you will create shortcut in"
type="string"
required="true"
/>
<named
name="SCN"
helpstring="the name of ShortCut"
type="string"
required="true"
/>
<named
name="TP"
helpstring="The path to the shortcut's executable."
type="string"
required="true"
/>
<named
name="WD"
helpstring="run under which directory"
type="string"
required="true"
/>
<named
name="A"
helpstring="Sets the arguments for a shortcut, or identifies a shortcut's arguments"
type="string"
required="false"
/>
<example>
Example:
WSCRIPT CreateShortCut.wsf /SF:E:/ /SCN:NotePad.lnk /TP:C:/Windows/Notepad.exe /WD:E:/
WSCRIPT CreateShortCut.wsf /SF:E:/ /SCN:NotePad.lnk /TP:C:/Windows/Notepad.exe /WD:E:/ /A:C:/Windows/ReadMe.txt</example>
</runtime>
<script language="VBScript">
<![CDATA[
Option Explicit
On Error Resume Next
Dim Args
Args = WScript.Arguments.Count
If Args < 4 Then
WScript.Arguments.ShowUsage
WScript.Quit
Else
Dim WshShell
Dim oShellLink
set WshShell = WScript.CreateObject("WScript.Shell")
Dim strShortCut
strShortCut = WScript.Arguments.Named.Item("SF") & WScript.Arguments.Named.Item("SCN")
set oShellLink = WshShell.CreateShortcut(strShortCut)
oShellLink.TargetPath = WScript.Arguments.Named.Item("TP")
oShellLink.WindowStyle = 1
oShellLink.Description = WScript.Arguments.Named.Item("SCN")
oShellLink.WorkingDirectory = WScript.Arguments.Item("WD")
If WScript.Arguments.Named.Item("A") <> "" Then
oShellLink.Arguments = WScript.Arguments.Named.Item("A")
End If
oShellLink.Save
End If
]]>
</script>
</job>
</package>
把上面的脚本粘贴复制到记事本,然后另存为CreateShortCut.wsf,双击就可以看见使用方法
博客介绍了一个用VBScript编写的创建快捷方式的脚本。该脚本可根据用户需求创建快捷方式,需指定特殊文件夹、快捷方式名称、可执行文件路径等参数,并给出了使用示例。将脚本保存为CreateShortCut.wsf后双击可查看使用方法。
3406

被折叠的 条评论
为什么被折叠?



