01.
Set
Fso = WScript.CreateObject(
"Scripting.FileSystemObject"
)
02.
strCurPath = WScript.ScriptFullName
03.
Set
obj = Fso.GetFile( strCurPath )
04.
Set
obj = obj.ParentFolder
05.
strCurPath = obj.Path
06.
07.
Set
WshShell = WScript.CreateObject(
"WScript.Shell"
)
08.
strDesktop = WshShell.SpecialFolders(
"Desktop"
)
09.
Set
oShellLink = WshShell.CreateShortcut(strDesktop &
"\WinOfSql.lnk"
)
10.
oShellLink.TargetPath = strCurPath &
"\WinOfSql.exe"
11.
oShellLink.WindowStyle = 1
12.
oShellLink.IconLocation = strCurPath &
"\WinOfSql.exe, 0"
13.
oShellLink.Description =
"ショートカット スクリプト."
14.
oShellLink.WorkingDirectory = strCurPath
15.
oShellLink.Save
16.
17.
Wscript.Echo
"デスクトップに"
& oShellLink.TargetPath &
"のショートカットが作成されました"