利用现有第三键、滚轮按键功能鼠标,配合它们的可以自定义按键功能的驱动(大部分都可以定义运行某个文件)
再利用 redtek 上传的 Windows Server 2003 的 choice.exe
http://www.cn-dos.net/forum/viewthread.php?tid=24011&fpage=1
制作一个鼠标小工具(驱动定义鼠标第三键、滚轮按键运行该批处理)
例:MTools.bat
@echo off
title 鼠标应用程序
mode con cols=35 lines=1
color 0b
CHOICE /C 123x /T 3 /D x /N /M " 1.记事本 2.计算器 3.命令提示符"
if %errorlevel% == 1 start notepad&exit
if %errorlevel% == 2 start calc&exit
if %errorlevel% == 3 cd/d c:\&start cmd&exit
虽然没有Yz Dock、ObjectDock Plus等华丽的界面、强大的功能,却有着更方便的使用方式和更低的资源占用(可以做成多级菜单方式)
也可以用 IE 制作漂亮的界面(启动稍慢,速度视 IE 界面脚本的大小)
@echo off
title 鼠标应用程序
mode con cols=15 lines=1
color 0b
>%Temp%\List.vbs echo set WshShell = Wscript.CreateObject("Wscript.Shell")
>>%Temp%\List.vbs echo Set fso = Wscript.CreateObject("Scripting.FileSystemObject")
>>%Temp%\List.vbs echo fso.DeleteFile("%Temp%\List.vbs")
>>%Temp%\List.vbs echo set ie=wscript.createobject("internetexplorer.application","event_")
>>%Temp%\List.vbs echo ie.fullscreen=1
>>%Temp%\List.vbs echo ie.width=300
>>%Temp%\List.vbs echo ie.height=56
>>%Temp%\List.vbs echo ie.navigate "about:blank"
>>%Temp%\List.vbs echo ie.left=fix((ie.document.parentwindow.screen.availwidth-ie.width)/2)
>>%Temp%\List.vbs echo ie.top=fix((ie.document.parentwindow.screen.availheight-ie.height)/2)
>>%Temp%\List.vbs echo ie.visible=1
>>%Temp%\List.vbs echo with ie.document
>>%Temp%\List.vbs echo .write "<html><title>鼠标应用程序</title><body background='%Temp%\BlueshowBig.gif' bgcolor=#e3e5da scroll=no>"
>>%Temp%\List.vbs echo .write "<table width=240 bgcolor=#e7f1fa border=0 cellpadding=0 cellspacing=2 style='position:absolute;left:0;top:0;font-family:Tahoma,宋体;font-size:15px;color:#698cc2;border:#698cc2 1px solid';>"
>>%Temp%\List.vbs echo .write "<tr align=center bgcolor=#698cc2 style=color:#ffffff;><td><b>------选择项目------</b></font></td></tr><tr><td>"
>>%Temp%\List.vbs echo .write " <input id=notepad type=button value=记事本 name=R1>"
>>%Temp%\List.vbs echo .write " <input id=calc type=button value=计算器 name=R1>"
>>%Temp%\List.vbs echo .write " <input id=cmd type=button value=命令提示符 name=R1><br>"
>>%Temp%\List.vbs echo .write "</td></tr></table></body>"
>>%Temp%\List.vbs echo .write "<body oncontextmenu='return false' ondragstart='return false' onselectstart ='return false' onselect='document.selection.empty()' oncopy='document.selection.empty()' onbeforecopy='return false'onmouseup='document.selection.empty()'></body></html>"
>>%Temp%\List.vbs echo end with
>>%Temp%\List.vbs echo dim wmi
>>%Temp%\List.vbs echo set wnd=ie.document.parentwindow
>>%Temp%\List.vbs echo set id=ie.document.all
>>%Temp%\List.vbs echo id.notepad.onclick=getref("notepad")
>>%Temp%\List.vbs echo id.calc.onclick=getref("calc")
>>%Temp%\List.vbs echo id.cmd.onclick=getref("cmd")
>>%Temp%\List.vbs echo do while true
>>%Temp%\List.vbs echo wscript.sleep 200
>>%Temp%\List.vbs echo WshShell.AppActivate ("鼠标应用程序 - Microsoft Internet Explorer")
>>%Temp%\List.vbs echo wscript.sleep 3000
>>%Temp%\List.vbs echo Wscript.Echo "exit"
>>%Temp%\List.vbs echo ie.quit
>>%Temp%\List.vbs echo loop
>>%Temp%\List.vbs echo sub event_onquit
>>%Temp%\List.vbs echo wscript.quit
>>%Temp%\List.vbs echo end sub
>>%Temp%\List.vbs echo sub notepad
>>%Temp%\List.vbs echo Wscript.Echo "notepad"
>>%Temp%\List.vbs echo ie.quit
>>%Temp%\List.vbs echo end sub
>>%Temp%\List.vbs echo sub calc
>>%Temp%\List.vbs echo Wscript.Echo "calc"
>>%Temp%\List.vbs echo ie.quit
>>%Temp%\List.vbs echo end sub
>>%Temp%\List.vbs echo sub cmd
>>%Temp%\List.vbs echo Wscript.Echo "cmd"
>>%Temp%\List.vbs echo ie.quit
>>%Temp%\List.vbs echo end sub
for /f "tokens=*" %%i in ('"cscript //nologo %Temp%\List.vbs"') do (
if "%%i"=="notepad" start notepad&exit
if "%%i"=="calc" start calc&exit
if "%%i"=="cmd" cd/d c:\&start cmd&exit)
if "%%i"=="exit" exit)
exit
上面一段最好使用 Quick BFC 打包为幽灵程序使用
(本人显示器设定 120 DPI 字体,大多数人 96 DPI 字体方式显示界面可能不正确,修改“width=300”“height=56”即可)