本帖最后由 kld_map 于 2012-6-26 14:26 编辑
懒人包·WindowsXP系统下快速复制某个文件的完整路径到剪贴板
此贴非原创,网络转载,本人不会VBS,这么高深的东西
附:请高手帮忙解决一个小BUG,这个VBS获取到的完整路径是带双引号的 “” ,不知道改哪里,可以去掉双引号
操作步骤[不会的同学直接下载懒人包内含视频教程]
第一,下载微软一个小程序:(不到6K)ftp://ftp.microsoft.com/Services/TechNet/samples/PS/Win98/Reskit/FILE/CLIP.EXE
第二,将下面的内容保存为copypath.vbs- '"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- 'COPYRIGHT NOTICE: This script and all material at weibo.com/hdtop are registered
- 'with "The UK Copyright Service". No part of the Website can be distributed or ...
- 'republished without the author's written permission.
- 'Copyright ?2008 by HDTOP. All rights reserved.
- '"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- 'CopyPath.vbs - File description
- '"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- 'Copy the Path of a file or folder to the Clipboard
- 'Created on May 10, 2008
- 'Copyright ?2008 Ramesh Srinivasan.
- 'Author: Ramesh Srinivasan, Microsoft MVP (Windows Desktop Experience)
- 'Website: weibo.com/hdtop
- '"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- Set WshShell = WScript.CreateObject("WScript.Shell")
- strMsg = "Completed!" & Chr(10) & Chr(10) & "CopyPath.vbs - ?2008 Ramesh Srinivasan" & Chr(10) & Chr(10) & "Visit us at weibo.com/hdtop"
- strBaseBrch= "HKLM\Software\Classes"
- If WScript.Arguments.Count <> 0 Then
- WshShell.run "%comspec% /c " & "echo " & chr(34) & _
- WScript.Arguments.Item(0) & chr(34) & "| clip.exe",0
- Else
- rtn= Trim(UCase(InputBox ("Type INSTALL to add the COPY AS PATH context menu option, or type UNINSTALL if you wish to remove the context menu option from your system.", "Configuring CopyPath.vbs...", "INSTALL")))
- If rtn = "INSTALL" Then RunInstall
- If rtn = "UNINSTALL" Then RunUninstall
- End if
- Sub RunInstall
- 'Add registry values
- On Error Resume Next
- strCMD = "wscript.exe %systemroot%\copypath.vbs " & Chr(34) & "%1" & Chr(34)
- WshShell.RegWrite strBaseBrch & "Allfilesystemobjects\shell\Copypath", "Copy as Path", "REG_SZ"
- WshShell.RegWrite strBaseBrch & "Allfilesystemobjects\shell\CopyPath\Extended", "", "REG_SZ"
- WshShell.RegWrite strBaseBrch & "Allfilesystemobjects\shell\CopyPath\command", strCMD, "REG_EXPAND_SZ"
- On Error Goto 0
- MsgBox strMsg, vbokonly,"Installed"
- End Sub
- Sub RunUninstall
- 'Remove the registry values added by this script.
- On Error Resume Next
- WshShell.RegDelete strBaseBrch & "Allfilesystemobjects\shell\CopyPath\command"
- WshShell.RegDelete strBaseBrch & "Allfilesystemobjects\shell\CopyPath"
- On Error Goto 0
- MsgBox strMsg, vbokonly,"Uninstalled"
- End Sub
- '""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- 'This script was brought to you by "新浪微博"
- 'Visit us at weibo.com/hdtop
- '""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
复制代码 第三, 上面两个文件,即copypath.vbs和CLIP.EXE都放到c:\windows目录下面,然后双击copypath.vbs,确定 之。
OK. 现在试试 按住shift后鼠标右键一个文件的时候,菜单里面是不是多出了个“复制为路径”了?
[懒人包+视频演示]下载地址 kuai.xunlei.com/d/SGKDLCJMNOKT
|