找回密码
 注册
搜索
[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
查看: 19526|回复: 4

[文件操作] 将剪贴板中的内容保存为文件

[复制链接]
发表于 2008-12-22 21:14:31 | 显示全部楼层 |阅读模式
可否将系统剪贴板中的内容保存为文件?例如剪贴板中为文字,则保存为文本文件;若剪贴板中为图片,则保存为jpg。保存在桌面。
发表于 2008-12-22 22:21:36 | 显示全部楼层
用命令行工具 nircmd

clipboard [Action] [Parameter]

Allows you to set a value into the clipboard and clear the clipboard.

[Action] may contain one of the following values:
  • set - set the specified text into the clipboard.
  • readfile - set the content of the specified text file into the clipboard.
  • clear - clear the clipboard.
  • writefile - write the content of the clipboard to a file. (text only)
  • addfile - add the content of the clipboard to a file. (text only)
  • saveimage - Save the current image in the clipboard into a file. The following file formats are supported: .bmp, .gif, .jpg, .png, .tiff Only works on computers with GDI+ installed (On XP/2003/Vista, GDI+ is installed as a part of the operating system).


Examples:
clipboard set "123456"
clipboard set ~$folder.desktop$
clipboard set ~$folder.start_menu$
clipboard readfile "c:\temp\info1.txt"
clipboard addfile "c:\temp\clip1.txt"
clipboard clear
clipboard saveimage "c:\temp\clip01.png"
clipboard saveimage "c:\temp\clip01.gif"


[ 本帖最后由 tireless 于 2008-12-22 22:23 编辑 ]
 楼主| 发表于 2008-12-22 23:16:53 | 显示全部楼层
这个工具我以前也听说过,但是帮助文件全是英文,水平有限,可以翻译一下吗?
 楼主| 发表于 2008-12-23 01:01:35 | 显示全部楼层

回复 2楼 的帖子

请问我应该如何调用这个文件呢?运行该批处理时提示“'clipboard' 不是内部或外部命令,也不是可运行的程序或批处理文件。”
发表于 2008-12-23 02:32:30 | 显示全部楼层
和批处理文件放到同一个文件夹下就行。
此贴应放到代码咨询与讨论区吧。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|批处理之家 ( 渝ICP备10000708号 )

GMT+8, 2026-3-17 01:45 , Processed in 0.013064 second(s), 8 queries , File On.

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表