自定义文件关联打开方式,热键为F4
#Persistent
F4:: ;实现ClipboardPath 功能还可以自由扩展,比如对rar文件即解压缩,对mp3文件立即播放等等
temp = %Clipboard%
Clipboard =
Send, ^c
ClipWait
If !ErrorLevel
{
FullFileName=%Clipboard%
FoundPos := RegExMatch(FullFileName, "\.(rar|gz|tar|zip|bz2)$")
If (FoundPos != 0)
{
MSGBOX 压缩文件
}
; 取出所有信息:
SplitPath, FullFileName, name, dir, ext, name_no_ext, drive
IF ext in bmp,jpg,png
run,"d:\Design\Paint.Net\PaintDotNet.exe" "%FullFileName%"
else if ext in txt,ahk,c,ini
Run "D:\k_wps_cn\greenTools\AkelPad\AkelPad.exe" "%FullFileName%"
else if ext in avi,rm,rmvb,wmv,mpg,mpeg,flv,mp4
run,"d:\internet\Tencent\QQPlayer\QQPlayer.exe" "%FullFileName%"
else
MsgBox 显示选择对话框,或默认从reged中读取
}
Clipboard = %temp%
Return
不用copy也可以获取文件路径的,请猛戳 http://blog.csdn.net/liuyukuan/article/details/53399286