首先这个工具大量代码来自群文件,我差不多做了个汇总,里面装软件用的批处理文件是我自己写的,其他的仅仅是我的聚合
附件不会上传,如果有人想玩玩的话我试试搞个网盘存着
gosub CreatTrayMenu
loop, %0%
{
param := %A_Index% ; Fetch the contents of the variable whose name is contained in A_Index.
params .= A_Space . param
}
ShellExecute := A_IsUnicode ? "shell32\ShellExecute":"shell32\ShellExecuteA"
if not A_IsAdmin
{
if A_IsCompiled
DllCall(ShellExecute, uint, 0, str, "RunAs", str, A_ScriptFullPath, str, params , str, A_WorkingDir, int, 1)
else
DllCall(ShellExecute, uint, 0, str, "RunAs", str, A_AhkPath, str, """" . A_ScriptFullPath . """" . A_Space . params, str, A_WorkingDir, int, 1)
ExitApp
}
#WinActivateForce
#InstallKeybdHook
#InstallMouseHook
#Persistent ;让脚本持久运行(关闭或ExitApp)
#MaxMem 4 ;max memory per var use
#NoEnv
#SingleInstance Force
#MaxHotkeysPerInterval 10000 ;Avoid warning when Mouse wheel turned very fast
SetBatchLines -1 ;让脚本无休眠地执行(换句话说,也就是让脚本全速运行)
SetKeyDelay -1 ;设置每次Send和ControlSend发送键击后自动的延时,使用-1表示无延时
Process Priority,,High ;线程,主,高级别
;查看电脑型号
command_pcname = wmic csproduct get name
pcname := cmdSilenceReturn(command_pcname)
pcname := StrReplace(pcname, A_Space, "")
pcname := StrReplace(pcname, "`r`n")
pcname := SubStr(pcname, 5, StrLen(pcname))
;读取bios sn
command_sn = wmic bios get serialnumber
bios_sn := cmdSilenceReturn(command_sn)
bios_sn := StrReplace(bios_sn, A_Space, "")
bios_sn := StrReplace(bios_sn, "`r`n")
bios_sn := SubStr(bios_sn, 13, StrLen(bios_sn))
NetIPAPI:=GetNetIPAPI()
Gui Add, Text, w-2 h-2 section
Gui Add,Button,g查看电源 ys-4,查看电源
Gui Add,Button,g备用键盘 x+5,备用键盘
Gui Add,Button,g可用接口 x+5,可用接口
Gui Add,Button,g监控接口 x+5,监控接口
Gui Add,Button,g连接状态 x+5,连接状态
Gui Add,Button,g多核监控 xs+1,多核监控
Gui Add,Button,g任务管理器 x+5,任务管理器
Gui Add,Button,g自动装软件 x+5,自动装软件
Gui Font, s9
Gui Add, ListView, xs-4 w400 h200 Grid NoSortHdr -Hdr NoSort -Multi, 项目|详细信息
LV_ModifyCol(1, 62)
LV_ModifyCol(2, 400)
LV_Add("", "型号", pcname)
LV_Add("", "序列号", bios_sn)
LV_Add("", "硬盘", (DriveIsSDD(A_WinDir)?"固态":"机械"))
LV_Add("", "内存", GetPhysicallyInstalledSystemMemory())
LV_Add("", "CPU线程数", NtQuerySystemInformation())
LV_Add("", "IP", NetIPAPI[1])
LV_Add("", "地址", NetIPAPI[2])
LV_Add("", "运营商", NetIPAPI[3])
LV_Add("", "当前字体", GetDefaultFontName())
Gui Show, w400 h300, 装机装得好`,备胎做到老`,米其林轮胎万岁
Return
自动装软件:
run 安装.bat
return
可用接口:
run .\NetWork\列出计算机的所有可用接口.ahk
Return
监控接口:
run .\NetWork\监控网络接口1.ahk
Return
连接状态:
run .\NetWork\获取网络连接状态.ahk
Return
多核监控:
run CPU多核监控NtQuery_CPU_Usage.ahk
Return
任务管理器:
run 任务管理器.ahk
Return
CreatTrayMenu:
Menu,Tray,NoStandard
Menu,Tray,add,Edit编辑脚本(&E),Menu_Edit
Menu,Tray,add,Open自身监视(&O),Menu_Open
Menu,Tray,add
Menu,Tray,add,开启或关闭随系统自动启动,Menu_AutoStart
Menu,Tray,add
Menu,Tray,add,重启(&R),Menu_Reload
Menu,Tray,add
Menu,Tray,add,暂停热键(&S),Menu_Suspend
Menu,Tray,add,暂停脚本(&A),Menu_Pause
Menu,Tray,add,退出(&X),Menu_Exit
menu,Tray,icon, 备胎.ico
return
Menu_Open:
ListLines
return
Menu_Edit:
Edit
return
Menu_reload:
Reload
return
Menu_AutoStart:
if A_Is64bitOS
SetRegView 64
RegRead, OutputVar, HKEY_LOCAL_MACHINE, Software\Microsoft\Windows\CurrentVersion\Run, CapsEz
if OutputVar
{
RegDelete, HKEY_LOCAL_MACHINE, Software\Microsoft\Windows\CurrentVersion\Run, CapsEz
btt("已关闭随系统自动启动",,,, "Style1")
Sleep 1000
btt()
}
else
{
RegWrite, REG_SZ, HKEY_LOCAL_MACHINE, Software\Microsoft\Windows\CurrentVersion\Run, CapsEz, "%A_AhkPath%"
btt("已设置为随系统自动启动",,,, "Style1")
Sleep 1000
btt()
}
return
Menu_Suspend:
Menu,tray,ToggleCheck,暂停热键(&S)
Suspend
return
Menu_Pause:
Menu,tray,ToggleCheck,暂停脚本(&A)
Pause
return
Menu_Exit:
ExitApp
return
Quit:
ExitApp
#Include 电源.ahk
#Include 备用键盘.ahk
#Include 硬盘内存.ahk
#Include IP.ahk
#Include 当前字体.ahk
cmdSilenceReturn(command){
CMDReturn:=""
cmdFN:="RunAnyCtrlCMD"
try{
RunWait,% ComSpec " /C " command " > ""%Temp%\" cmdFN ".log""",, Hide
FileRead, CMDReturn, %A_Temp%\%cmdFN%.log
FileDelete,%A_Temp%\%cmdFN%.log
}catch{}
return CMDReturn
}
NtQuerySystemInformation() { ; http://msdn.com/library/ms724509(vs.85,en-us)
static hModule := DllCall("LoadLibrary", "Str", "ntdll.dll", "Ptr")
size := VarSetCapacity(buf, 0, 0)
DllCall("ntdll\NtQuerySystemInformation", "Int", 0x8, "Ptr", &buf, "UInt", 0, "UInt*", size)
size := VarSetCapacity(buf, size, 0)
if (DllCall("ntdll\NtQuerySystemInformation", "Int", 0x8, "Ptr", &buf, "UInt", size, "UInt*", 0) != 0)
return "*" ErrorLevel
CPU_COUNT := size // 48
return CPU_COUNT
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。