<?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,双击就可以看见使用方法