|  | 
 
| tireless 银牌会员
 
      
 
 
 
 积分 2025
 发帖 1122
 注册 2007-9-5
 状态 离线
 | 
| 『楼 主』:
 如何添加个“发送到桌面快捷方式”的右键
 
使用 LLM 解释/回答一下 
 
 
系统里的“发送到”实在让人受不了,要几秒才显示出发送到菜单
 想在右键加个菜单---发送到桌面快捷方式
 ·  如果是文件,创建的快捷方式最好不带扩展名
 ·  能针对多个文件
 ·  最好不要闪cmd窗口
 ·  利用其他工具也行,如shortcut、nircmd
 
The "Send To" in the system is really unbearable. It takes a few seconds to display the Send To menu.
 I want to add a menu in the right-click - Send To Desktop Shortcut.
 · If it is a file, the created shortcut should preferably not have an extension.
 · Can be for multiple files.
 · It is best not to flash the cmd window.
 · It is also okay to use other tools, such as shortcut, nircmd.
 
 
 
 |  | 
|  2008-4-14 21:23 |  | 
|  | 
 
| slore 铂金会员
 
        
 
 
 
 积分 5212
 发帖 2478
 注册 2007-2-8
 状态 离线
 | 
| 『第 2 楼』:
 DesktopLink.vbs---By Slore
 
使用 LLM 解释/回答一下 
 
 
引用的就不算我说话了~郁闷~~~打空格也不行。。。
 '-----------------DesktopLink.vbs---By Slore At 2008-04-15------------------
 '
 '脚本说明:
 '放到任意目录,双击即可安装/卸载。
 '欢迎您的测试以及给我提供宝贵意见。
 '如果你喜欢,请随意转载,但请勿随意修改。
 '                                      http://bbs.cn-dos.net
 '
 '意见反馈:1.论坛消息
 '         2.email:slorelee@yahoo.com.cn
 '---------------------------------------------------------转载请保留我:)----
 Dim strArg,strDesktop,strBsname
 Set objShell = WScript.CreateObject("WScript.Shell")
 ArgCount = wscript.Arguments.Count
 If ArgCount = 0 Then
 strArg = "在右键添加一个发送到桌面快捷方式选项:" & vbCrLf
 ret = MsgBox( strArg & "是 否 取消",67,"By Slore")
 strArg = "HKCR\AllFilesystemObjects\Shell\Slore\"
 If ret = 6 Then
 strCommand = "Wscript.exe """ & WScript.ScriptFullName & """ ""%1"""
 objShell.RegWrite strArg,"桌面快捷方式(&L)"
 objShell.RegWrite strArg & "Command\", strCommand
 MsgBox "菜单已添加成功!..o(∩_∩)o..",64,"By Slore"
 ElseIf ret = 7 Then
 objShell.RegDelete strArg & "Command\"
 objShell.RegDelete strArg
 MsgBox "该菜单已删除!",64,"By Slore"
 End If
 wscript.Quit
 End If
 
 Set objFSO = CreateObject("Scripting.FileSystemObject")
 strDesktop = objShell.SpecialFolders("Desktop")
 For i = 0 To ArgCount - 1
 strArg = wscript.arguments.item(i)
 strBsname = objFSO.GetBaseName(strArg)
 strTarget = strDesktop & "\" & strBsname
 If Not CST(strTarget,".lnk") Then CST strTarget,".pif"
 Next
 
 Function CST(strPath,strExt)
 n = 1:CST = True
 on Error Resume Next
 Do While objFSO.FileExists(strPath & strExt)
 n = n + 1
 strTarget = strDesktop & "\" & strBsname & " (" & n & ")"
 Loop
 Set oShellLink = objShell.CreateShortcut(strPath & ".lnk")
 oShellLink.TargetPath = strArg
 oShellLink.WorkingDirectory = objFSO.GetParentFolderName(strArg)
 oShellLink.Save
 If Err Then Err.Clear:CST = False
 End Function
 
 Set oShellLink = Nothing
 Set objShell = Nothing
 Set objFSO = Nothing
 
 
 
Quoted parts don't count as my words~郁闷~~~Spaces don't work either...
 '-----------------DesktopLink.vbs---By Slore At 2008-04-15------------------
 '
 '脚本说明:
 'Place it in any directory and double-click to install/uninstall.
 'Welcome your testing and provide valuable feedback.
 'If you like it, feel free to repost, but do not modify it casually.
 '                                      http://bbs.cn-dos.net
 '
 '意见反馈:1.论坛消息
 '         2.email:slorelee@yahoo.com.cn
 '---------------------------------------------------------Please keep me when reposting----
 Dim strArg,strDesktop,strBsname
 Set objShell = WScript.CreateObject("WScript.Shell")
 ArgCount = wscript.Arguments.Count
 If ArgCount = 0 Then
 strArg = "Add a 'Send to Desktop Shortcut' option to the right-click:" & vbCrLf
 ret = MsgBox( strArg & " Yes No Cancel",67,"By Slore")
 strArg = "HKCR\AllFilesystemObjects\Shell\Slore\"
 If ret = 6 Then
 strCommand = "Wscript.exe """ & WScript.ScriptFullName & """ ""%1"""
 objShell.RegWrite strArg,"Desktop Shortcut(&L)"
 objShell.RegWrite strArg & "Command\", strCommand
 MsgBox "Menu added successfully!..o(∩_∩)o..",64,"By Slore"
 ElseIf ret = 7 Then
 objShell.RegDelete strArg & "Command\"
 objShell.RegDelete strArg
 MsgBox "This menu has been deleted!",64,"By Slore"
 End If
 wscript.Quit
 End If
 
 Set objFSO = CreateObject("Scripting.FileSystemObject")
 strDesktop = objShell.SpecialFolders("Desktop")
 For i = 0 To ArgCount - 1
 strArg = wscript.arguments.item(i)
 strBsname = objFSO.GetBaseName(strArg)
 strTarget = strDesktop & "\" & strBsname
 If Not CST(strTarget,".lnk") Then CST strTarget,".pif"
 Next
 
 Function CST(strPath,strExt)
 n = 1:CST = True
 on Error Resume Next
 Do While objFSO.FileExists(strPath & strExt)
 n = n + 1
 strTarget = strDesktop & "\" & strBsname & " (" & n & ")"
 Loop
 Set oShellLink = objShell.CreateShortcut(strPath & ".lnk")
 oShellLink.TargetPath = strArg
 oShellLink.WorkingDirectory = objFSO.GetParentFolderName(strArg)
 oShellLink.Save
 if Err Then Err.Clear:CST = False
 End Function
 
 Set oShellLink = Nothing
 Set objShell = Nothing
 Set objFSO = Nothing
 
 
 
 
 |  | 
|  2008-4-15 03:07 |  | 
|  | 
 
| tireless 银牌会员
 
      
 
 
 
 积分 2025
 发帖 1122
 注册 2007-9-5
 状态 离线
 | 
| 『第 3 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
谢谢slore,很不错。就是创建多个快捷方式有点慢,能像系统的那样快就好了 
Thanks slore, it's very good. It's just that creating multiple shortcuts is a bit slow. It would be nice if it could be as fast as the system's. 
 
 
 |  | 
|  2008-4-15 08:11 |  | 
|  | 
 
| zh159 金牌会员
 
       
 
 
 积分 3687
 发帖 1467
 注册 2005-8-8
 状态 离线
 | 
| 『第 4 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
2 楼的可以在选定多个文件后创建多个快捷方式
 Last edited by zh159 on 2008-4-15 at 09:53 AM ]
 
The user on floor 2 can create multiple shortcuts after selecting multiple files.
 Last edited by zh159 on 2008-4-15 at 09:53 AM ]
 
 
 
 
 |  
                  |  
  |  | 
|  2008-4-15 09:48 |  | 
|  | 
 
| slore 铂金会员
 
        
 
 
 
 积分 5212
 发帖 2478
 注册 2007-2-8
 状态 离线
 | 
| 『第 5 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
Originally posted by tireless at 2008-4-15 08:11:谢谢slore,很不错。就是创建多个快捷方式有点慢,能像系统的那样快就好了
 
已经尽量了。但是知识还是不够。。。 
调用系统的那个DESKLINK,但是是 CLSID那种…… 
这个其实选多个,也没有进循环。。。
 
是每个文件调用一次DESKLINK.VBS,所以……选的越多越卡,会一下运行n个wscript...
 
所以如果是多个还是SENDTO下吧<img src="images/smilies/face-raspberry.png" align="absmiddle" border="0">
 
PS:我这里的SENDTO显示很快呀~~~你是不是里面项目太多了? 
Originally posted by tireless at 2008-4-15 08:11:Thanks slore, it's very good. Just creating multiple shortcuts is a bit slow, it would be nice if it was as fast as the system one
 
Already tried my best. But still lack knowledge... 
Calling the system's that DESKLINK, but it's CLSID kind... 
Actually selecting multiple, there's no loop entered...
 
It's calling DESKLINK.VBS for each file, so... the more selected, the slower it gets, will run n wscript... at once
 
So if it's multiple, just use SENDTO ~~:P
 
PS: SENDTO shows very fast here~~~ Is there too many items in yours? 
 
 
 |  | 
|  2008-4-15 12:48 |  | 
|  | 
 
| tireless 银牌会员
 
      
 
 
 
 积分 2025
 发帖 1122
 注册 2007-9-5
 状态 离线
 | 
| 『第 6 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
Originally posted by slore at 2008-4-14 04:48 PM:
 
 PS:我这里的SENDTO显示很快呀~~~你是不是里面项目太多了?
 
不,即使只留下一个“桌面快捷方式”,那菜单的显示速度也让我很郁闷。。。
 
用shortcut或nircmd应该比较快,怎么用? 
Originally posted by slore at 2008-4-14 04:48 PM:
 
 PS: The SENDTO here shows very quickly~~~ Is it that you have too many items inside?
 
No, even if only leaving a "Desktop Shortcut", the display speed of that menu still makes me very depressed...
 
How to use shortcut or nircmd? It should be relatively fast. 
 
 
 |  | 
|  2008-4-15 20:35 |  | 
|  | 
 
| sylovanas 初级用户
 
   
 
 
 
 积分 107
 发帖 42
 注册 2007-9-3
 状态 离线
 | 
| 『第 7 楼』:
 
 
使用 LLM 解释/回答一下 
 
 
1.bat内容
 @echo off
 if exist %temp%\1.txt del 1.txt /q >nul 2>nul
 for %%a in (%*) do echo shortcut "%%~a" "~$folder.desktop$" "%%~na">>%Temp%\1.txt
 nircmd script %temp%\1.txt
 
 加入右键选单的内容
 
 nircmd execmd 1.bat %*
 
 Last edited by sylovanas on 2008-4-15 at 09:00 PM ]
 
1.bat content
 @echo off
 if exist %temp%\1.txt del 1.txt /q >nul 2>nul
 for %%a in (%*) do echo shortcut "%%~a" "~$folder.desktop$" "%%~na">>%Temp%\1.txt
 nircmd script %temp%\1.txt
 
 Content to add to the right-click menu
 
 nircmd execmd 1.bat %*
 
 Last edited by sylovanas on 2008-4-15 at 09:00 PM ]
 
 
 
 |  | 
|  2008-4-15 20:57 |  |