http://www.linuxdiyf.com/1/czxt/2006/0713/content_1241.htm
这个脚本.桌面的快捷方式.只有拨号的快捷方式有这个菜单.分区软件发到桌面的快捷方式无此菜单
如何让桌面快捷方式都有这个并能用菜单
VBS源码
'==========================================================================
'
' NAME: ShowLnkTarget.vbs
'
' AUTHOR: SleepBoy
' DATE : 2006-1-12
'
' COMMENT: 快速显示“快捷方式”中“目标”所在的位置,并把焦点停留在目标上。
'
' 安装说明:1. 放在任意目录中,直接双击脚本,即可完成安装。
' 2. 安装好之后,右键单击快捷方式,会出现一项“显示目标位置”。
' 3. 如果移动了脚本的位置,请再安装一次。
' 4. 脚本名字可以改变。改好之后,请再安装一次。
'
'==========================================================================
Option Explicit
Dim objArgs, WshShell
Set objArgs = WScript.Arguments
Set WshShell = WScript.CreateObject("WScript.Shell")
If objArgs.Count = 1 Then
ShowLnkTarget
ElseIf objArgs.Count = 0 Then
Setup
End If
'==========================================================================
Sub Setup
Dim QM
QM = """"
WshShell.RegWrite "HKCR\lnkfile\shell\ShowLnkTarget\", "显示目标位置"
WshShell.RegWrite "HKCR\lnkfile\shell\ShowLnkTarget\command\", _
QM & WScript.FullName & QM & " " & _
QM & WScript.ScriptFullName & QM & " " & _
QM & "%1" & QM
MsgBox "安装完毕!",64,WScript.ScriptName
End Sub
'---------------------------------------------------------------------------
Sub ShowLnkTarget
Dim lnkname, strComputer, objWMIService, colFiles, objFile
lnkname = Replace(objArgs(0),"\","\\")
strComputer = "."
Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\cimv2")
Set colFiles = objWMIService.ExecQuery _
("Select * From Win32_ShortcutFile WHERE Name = " & "'" & lnkname & "'")
For Each objFile in colFiles
WshShell.Run ("explorer /n, /select," & objFile.Target)
Next
End Sub
'==========================================================================
Last edited by eech on 2006-12-11 at 10:01 AM ]