zoukankan      html  css  js  c++  java
  • xp下也能像vista那样快速复制某个文件的完整路径到剪贴板

    xp下也能像vista那样快速复制某个文件的完整路径到剪贴板

    以前在xp下的cmd可以将文件拖拽进来,但是在vista下, 我发现了一个很恶心的“new feature”,就是居然把这个功能去掉了。如果要获得一个文件的完整路径总是得手动通过“重命名”将文件名复制取出来,再拿到地址栏和那个路劲拼起 来, 如果是长文件名的话还要注意左右都加上个"符号,真的是相当的烦……

    不过我相信微软不会这么无耻下贱的,于是google一番,发现到了很多人和我一样抱怨的帖子,也从那些帖子里才发现,原来居然有个隐藏指令,可以很方便的复制一个文件完整路径到剪贴板, 这样也算是弥补了不能拖拽文件到cmd的缺陷吧。

    操作很简单: 就是 先按住SHIFT,然后鼠标右键一个文件的时候,菜单里面会多出个“复制为路径”。 这样就可以将这个文件的完整路径的text复制出来

    ===================无聊的分割线=====================

    然后百度了下,原来介绍这个技巧的文章很泛滥。哎,惭愧。 如果你没发现你的右键菜单里面有多出个“复制为路径”,那么你的系统就是?我说的是VISTA~~~~~(难道你在XP下照着操作了^_!)

    不过我觉得我很多时候用xp时, 也很需要这个特性, 于是在google上也发现了可以简单实现的方法。原文:http://www.winhelponline.com/blog/add-copy-as-path-option-to-the-context-menu-in-windows-xp/

    第一,下载微软一个小程序:(不到6K)ftp://ftp.microsoft.com/Services/TechNet/samples/PS/Win98/Reskit/FILE/CLIP.EXE

    下载地址http://xiazai.jb51.net/201101/tools/clip.rar

    第二,将下面的内容保存为copypath.vbs

    下载地址

    http://www.winhelponline.com/blog/wp-content/uploads/copypath.vbs

    ASP/Visual Basic代码
    1. '"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""   
    2. 'COPYRIGHT NOTICE: This script and all material at Winhelponline.com are registered   
    3. 'with "The UK Copyright Service". No part of the Website can be distributed or ...   
    4. 'republished without the author's written permission.   
    5. 'Copyright ?2008 by Ramesh Srinivasan. All rights reserved.   
    6. '"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""   
    7. 'CopyPath.vbs - File description   
    8. '"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""   
    9. 'Copy the Path of a file or folder to the Clipboard   
    10. 'Created on May 10, 2008   
    11. 'Copyright ?2008 Ramesh Srinivasan.   
    12. 'Author: Ramesh Srinivasan, Microsoft MVP (Windows Desktop Experience)   
    13. 'Website: http://www.winhelponline.com   
    14. '"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""   
    15. Set WshShell = WScript.CreateObject("WScript.Shell")   
    16. strMsg = "Completed!" & Chr(10) & Chr(10) & "CopyPath.vbs - ?2008 Ramesh Srinivasan" & Chr(10) & Chr(10) & "Visit us at http://www.winhelponline.com/blog"  
    17. strBaseBrch= "HKLM\Software\Classes\"  
    18. If WScript.Arguments.Count <> 0 Then  
    19. WshShell.run "%comspec% /c " & "echo " & chr(34) & _  
    20. WScript.Arguments.Item(0) & chr(34) & "| clip.exe",0  
    21. Else  
    22. 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")))  
    23. If rtn = "INSTALL" Then RunInstall  
    24. If rtn = "UNINSTALL" Then RunUninstall  
    25. End if  
    26. Sub RunInstall  
    27. 'Add registry values  
    28. On Error Resume Next  
    29. strCMD = "wscript.exe %systemroot%\copypath.vbs " & Chr(34) & "%1" & Chr(34)  
    30. WshShell.RegWrite strBaseBrch & "Allfilesystemobjects\shell\Copypath\", "Copy as Path", "REG_SZ"  
    31. WshShell.RegWrite strBaseBrch & "Allfilesystemobjects\shell\CopyPath\Extended", "", "REG_SZ"  
    32. WshShell.RegWrite strBaseBrch & "Allfilesystemobjects\shell\CopyPath\command\", strCMD, "REG_EXPAND_SZ"  
    33. On Error Goto 0  
    34. MsgBox strMsg, vbokonly,"Installed"  
    35. End Sub  
    36. Sub RunUninstall  
    37. 'Remove the registry values added by this script.  
    38. On Error Resume Next  
    39. WshShell.RegDelete strBaseBrch & "Allfilesystemobjects\shell\CopyPath\command\"  
    40. WshShell.RegDelete strBaseBrch & "Allfilesystemobjects\shell\CopyPath\"  
    41. On Error Goto 0  
    42. MsgBox strMsg, vbokonly,"Uninstalled"  
    43. End Sub  
    44. '""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  
    45. 'This script was brought to you by "The Winhelponline Blog"  
    46. 'Visit us at http://www.winhelponline.com/blog  
    47. '""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""  

    第三, 上面两个文件,即copypath.vbs和CLIP.EXE都放到c:\windows目录下面,然后双击copypath.vbs,确定 之。

    OK. 现在试试 按住shift后鼠标右键一个文件的时候,菜单里面是不是多出了个“复制为路径”了

  • 相关阅读:
    同步回调函数与异步回调函数示例
    关于js中的回调函数callback
    JavaScript callback function 回调函数的理解
    CSS“隐藏”元素的几种方法的对比
    JSF中run项目时候Tomcat8启动不了的一种方法
    The JSP specification requires that an attribute name is
    [转载]Windows 2003 R2 SP2 VOL 企业版(简体中文)
    ${pageContext.request.contextPath}相关问题总结
    最简单的java浏览器
    【转】像素存储容量的计算
  • 原文地址:https://www.cnblogs.com/showker/p/3104129.html
Copyright © 2011-2022 走看看