[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

右键菜单添加“保存剪贴板内容”

右键菜单添加“保存剪贴板内容”
  1. Windows Registry Editor Version 5.00
  2. ; 保存剪贴板内容_所有文件右键_添加.reg
  3. [HKEY_CLASSES_ROOT\AllFilesystemObjects\shell\SaveClipText]
  4. @="保存剪贴板内容(&B)"
  5. [HKEY_CLASSES_ROOT\AllFilesystemObjects\shell\SaveClipText\command]
  6. @="mshta \"javascript:try{new ActiveXObject('Scripting.FileSystemObject').OpenTextFile(new Date().getTime()+'.txt',2,true).Write(clipboardData.getData('text'));}catch(e){alert('non-text');}close();\""
复制代码
  1. Windows Registry Editor Version 5.00
  2. ; 保存剪贴板内容_所有文件右键_删除.reg
  3. [-HKEY_CLASSES_ROOT\AllFilesystemObjects\shell\SaveClipText]
复制代码
批处理如何在右键菜单中添加一键清空剪贴板的功能?
http://www.bathome.net/viewthread.php?tid=4541
  1. Windows Registry Editor Version 5.00
  2. ; 清空剪贴板_空白处右键_添加.reg
  3. [HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\ClearClipboard]
  4. @="{00000000-0000-0000-0000-000000000012}"
  5. [HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-000000000012}\InProcServer32]
  6. @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
  7.   00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,68,00,\
  8.   64,00,6f,00,63,00,76,00,77,00,2e,00,64,00,6c,00,6c,00,00,00
  9. "ThreadingModel"="Apartment"
  10. [HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-000000000012}\Instance]
  11. "CLSID"="{3f454f0e-42ae-4d7c-8ea3-328250d6e272}"
  12. [HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag]
  13. "method"="ShellExecute"
  14. "Param2"="mshta"
  15. "Param1"="vbscript:clipboardData.clearData()(close)"
  16. "command"="清空剪贴板"
  17. "CLSID"="{13709620-C279-11CE-A49E-444553540000}"
复制代码
  1. Windows Registry Editor Version 5.00
  2. ; 清空剪贴板_空白处右键_删除.reg
  3. [-HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\ClearClipboard]
  4. [-HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-000000000012}]
复制代码

[ 本帖最后由 zqz0012005 于 2010-6-28 20:47 编辑 ]
命令行参考:hh.exe ntcmds.chm::/ntcmds.htm
求助者请拿出诚心,别人才愿意奉献热心!
把查看手册形成条件反射!

TOP

复制文件(夹)到剪贴板

查看快捷方式的目标
  1. Windows Registry Editor Version 5.00
  2. [HKEY_CLASSES_ROOT\lnkfile\shell\Target]
  3. @="查看目标(&F)"
  4. [HKEY_CLASSES_ROOT\lnkfile\shell\Target\command]
  5. @="mshta vbscript:CreateObject(\"WScript.Shell\").Run(\"explorer /n,/select,\"&CreateObject(\"WScript.Shell\").CreateShortcut(\"%1\").TargetPath)(close)"
复制代码


复制lnk快捷方式的目标路径及参数
  1. Windows Registry Editor Version 5.00
  2. [HKEY_CLASSES_ROOT\lnkfile\shell\CopyLink]
  3. @="复制命令及参数(&G)"
  4. [HKEY_CLASSES_ROOT\lnkfile\shell\CopyLink\command]
  5. @="mshta vbscript:clipboardData.setData(\"text\",CreateObject(\"WScript.Shell\").CreateShortcut(\"%1\").TargetPath+chr(32)+CreateObject(\"WScript.Shell\").CreateShortcut(\"%1\").Arguments)(close)"
复制代码

复制URL快捷方式的目标地址
  1. Windows Registry Editor Version 5.00
  2. [HKEY_CLASSES_ROOT\InternetShortcut\shell\CopyLink]
  3. @="复制链接(&F)"
  4. [HKEY_CLASSES_ROOT\InternetShortcut\shell\CopyLink\command]
  5. @="mshta vbscript:clipboardData.setData(\"text\",CreateObject(\"WScript.Shell\").CreateShortcut(\"%1\").TargetPath)(close)"
复制代码
  1. Windows Registry Editor Version 5.00
  2. [HKEY_CLASSES_ROOT\AllFilesystemObjects\shell\CopyPath2Clip]
  3. @="复制文件路径到剪贴板(&W)"
  4. [HKEY_CLASSES_ROOT\AllFilesystemObjects\shell\CopyPath2Clip\command]
  5. @="mshta \"javascript:moveTo(-1000,-1000);document.write('<hta:application id=$ showInTaskbar=no />');fso=new ActiveXObject('Scripting.FileSystemObject');s=$.commandLine;q=String.fromCharCode(34);clipboardData.setData('text',s.match(new RegExp(q+'.*?'+q,'g')).pop().slice(1,-1));close();\" \"%1\""
复制代码
  1. Windows Registry Editor Version 5.00
  2. [HKEY_CLASSES_ROOT\txtfile\shell\CopyText2Clip]
  3. @="复制文本内容到剪贴板(&X)"
  4. [HKEY_CLASSES_ROOT\txtfile\shell\CopyText2Clip\command]
  5. @="mshta \"javascript:moveTo(-1000,-1000);document.write('<hta:application id=$ showInTaskbar=no />');fso=new ActiveXObject('Scripting.FileSystemObject');s=$.commandLine;q=String.fromCharCode(34);f=s.match(new RegExp(q+'.*?'+q,'g')).pop().slice(1,-1);clipboardData.setData('text',fso.OpenTextFile(f).ReadAll());close();\" \"%1\""
复制代码
【代码技巧】批处理拷贝文件(夹)到剪贴板
http://www.bathome.net/thread-4223-1-1.html
  1. @echo off
  2. call :c2cb "%ProgramFiles%\microsoft frontpage"
  3. exit /b
  4. ::Copy2ClipBoard
  5. :c2cb
  6. setlocal
  7. set "f=%~1"
  8. set "f=%f:\\=\%"
  9. set "f=%f:\=\\%"
  10. mshta "javascript:moveTo(screen.width,0);document.write('<img id=\'x\' src=\'%f%\'>');i=document.body.createControlRange();i.add(x);i.execCommand('copy');close()"
  11. goto :eof
复制代码
未完待续……

[ 本帖最后由 zqz0012005 于 2010-6-30 20:32 编辑 ]
命令行参考:hh.exe ntcmds.chm::/ntcmds.htm
求助者请拿出诚心,别人才愿意奉献热心!
把查看手册形成条件反射!

TOP

返回列表