电脑软件安装过程文档
;
;
电脑软件安装过程文档
徐晓亮
595076941@qq.com
2019年12月20日
///////////////////////////////////////
为了防止丢失此文档,引起今后找不到此文档,
现在特把此文档发布到以下3个博客中
作为备份副本重复文件拷贝保存:
此文档的副本备份网址1:
http://autohotkey.bokee.com/507512251.html
此文档的副本备份网址2:
https://www.cnblogs.com/delphixx/p/12072860.html
此文档的副本备份网址3:
https://gitee.com/weiyunwps618/codes/hc4zx7891wem6uifoba5v40
///////////////////////////////////////
1-备份原有文件
101-用FastCopy复制电脑中原有文档、表格、图片和数据库文件到移动硬盘。
( FastCopy过滤器包括*.doc;*.docx;*.xls;*.xlsx;*.jpg;*.ahk;*.bat )
102-备份宽带上网密码到移动硬盘。
103-备份网卡驱动、打印机驱动和高拍仪驱动到移动硬盘。
///////////////////////////////////////
2-安装电脑软件
201-全新安装“杏雨梨云USB维护系统”到“cz880闪迪固态u盘128g”中。 https://www.xyboot.com/
202-用FastCopy复制一键批量自动静默软件安装包和一键批量自动静默设置包到”cz880闪迪固态u盘128g”的XYLYUSBDAT数据分区中。
( 操作系统选用”MSDN我告诉你”网站上下载的微软原版Windows7ProSP1VL光盘ISO镜像文件 https://msdn.itellyou.cn/
64-cn-windows-7-professional-with-sp1-vl-build-x64-dvd-u-677816
大小: 3266004992字节 ISO-MD5: E9DB ISO-SHA1: 647B
32-cn-windows-7-professional-with-sp1-vl-build-x86-dvd-u-677939
大小2502909952字节 ISO-MD5: AC0D ISO-SHA1: 27AE )
203-对电脑本地磁盘重新分2个分区,C盘分区空间大小120GB
204-用“硬件检测Aida64”检测电脑中央处理器指令集
(32位还是64位)并用IQI9选择自动静默安装合适的操作系统。
( 说明:IQI9安装好微软原版操作系统后只需一次双击就可以批量自动静默的完成本文所述的各项安装和设置操作,一次双击批量自动静默完成所有操作并自动关闭电脑电源。
一键批量自动静默软件安装包选用我自己制作打包的单文件批量版,制作时使用了AutoHotkey,SciTE4AHK,Delphi,Easy7z,InstallRite2.5c汉化版等工具软件,批量操作前的批量复选面板界面用Delphi自己制作,制作时参考了”秋无痕论坛常用软件全功能装机光盘”和“宋永志一键软件安装管理器”在此对这些软件的创作作者、无私分享者和复制搬运者表示衷心感谢 )
205-用“Windows超级土狗”激活Windows操作系统
206-安装从大眼仔旭下载的Total-Uninstall-Setup-6.27.0.565
207-安装“360驱动大师万能网卡版”安装和更新电脑驱动程序
208-安装并测试网卡驱动、打印机驱动和高拍仪驱动
209-安装向日葵远程控制SunloginClient
https://Sunlogin.oray.com/perSonal/
210-登录并绑定向日葵远程控制SunloginClient
211-安装搜狗高速浏览器
212-复制一键GHOST硬盘版到文件夹C:\
213-安装-一键GHOST硬盘版
214-用个人文件转移工具pft.exe转移文件和文件夹到
D盘的Personal文件夹并检查文件夹转移设置是否成功
215-安装搜狗拼音输入法
216-安装搜狗五笔输入法
217-复制MasterSeeker.exe到D:\Program\MasterSeeker\MasterSeeker.exe
218-运行D:\Program\MasterSeeker\MasterSeeker.exe
并将MasterSeeker程序锁定到任务栏
219-安装从飞扬时空新浪博客下载的
”Total Commander 9.22a”电脑文件管理器到D:\Program\TotalCMD\Totalcmd.exe
220运行D:\Program\TotalCMD\Totalcmd.exe
并将Total Commander程序锁定到任务栏
221-安装FastCopy汉化版文件快速复制和删除软件
222-设置FastCopy汉化版文件快速复制和删除软件的右键菜单
223-安装WinRAR压缩软件
224-设置WinRAR默认压缩设置为ZIP并按掩码产生压缩文件名
225-安装AutoHotke到D:\Program\AutoHotkey\AutoHotkey.exe
226-安装SciTE4AutoHotkey到D:\Program\AutoHotkey\SciTE\SciTE.exe
227-复制AHKManager(含相关AHK脚本)到D:\Program\AHKManager\AHKManager.ahk
228-复制AHKManager.ahk的快捷方式到shell:startup启动文件夹以便能随系统一起自动启动
229-运行D:\Program\AHKManager\AHKManager.ahk
230-安装WPS-Office-2019-专业免激活-含VBA功能
231-安装Adobe Photoshop CS6简体中文版
232-安装从大眼仔旭下载的”USB Safely Remove”
233-安装腾讯QQ电脑版
234-安装腾讯微信PC版
235-安装腾讯微云网盘电脑版
236-安装天翼云盘电脑版
237-安装uTools到D:\Program\uTools\uTools.exe
238-设置uTools的自定义快捷方式目录为uTools中的lnks
239-安装EmEditor.Pro18.6.5文本编辑器
240-安装FileLocatorPro文档表格全文搜索软件
241-安装酷狗音乐盒kugou
242-优酷视频youku
243-爱奇艺视频IQIYI
244-逗游游戏盒doyo
245-网上银行小助手和网银USB-Key驱动程序
246-测试能否正常登录网上银行
247-安装ACDSee
248-InstallRite2.5c汉化版
249-安装并升级360杀毒软件
250-安装并升级360安全卫士
///////////////////////////////////////
3-设置并检测软件
301-设置windows登录密码为3322
302-自动登录系统
可运行命令 netplwiz来设置自动登录系统
可运行命令 Control userpasswords2 来设置自动登录系统
可运行命令 Rundll32 netplwiz.dll,UsersRunDll 来设置登录303-桌面背景改成纯色
304-屏幕保护程序
空白 等待29分钟 选中在恢复时显示登录屏幕
if(A-TimeIdle>1740000)
Run,C:\Windows\System32\Rundll32.Exe user32.dll LockWorkStation
305-电源设置
关闭显示器 30分钟 使计算机进入睡眠状态 5小时
if(A-TimeIdle>1800000)
SendMessage, 0x112, 0xF170, 2,, Program Manager
306-在此时间后关闭硬盘0分钟从不
307-修改计算机全名为xuxlpc
308-局域网IP地址固定为192.168.10.233
309-用右键管家RightMenuMgr清理鼠标右键菜单中的无用项
删除鼠标右键菜单的新建菜单中的DOC文档和XLS工作表
只用docx和xlsx新建文档或表格时可以右击后按wd或wx
310-修改注册表项后可以单击鼠标右键然后按键盘WT快速新建文本文档
Windows Registry Editor Version 5.00
[HKEY-CLASSES-ROOT\Local Settings\MuiCache\6\AAF68885]
"@C:\\windows\\system32\\notepad.exe,-469"="TXT文本文档"
311-设置任务栏锁定MasterSeeker和Total Commander
312-设置自定义通知区域有选择的隐藏图标
313-复制到C盘根目录并设置每天22时05分定时强制关机精灵PCOff.exe
314-BIOS设置每天5时55分定时自动开机
315-清理删除电脑桌面无用图标
316-清理删除电脑开始菜单无用图标
317-清理删除电脑启动自动运行无用垃圾广告项目AutoRuns
318-安装并设置Serv-U-FTP电脑文件公网异地远程访问服务
319-安装并设置GoodSync-V10双向同步实时备份软件
320-根据电脑的具体使用情况有选择的安装其他电脑软件
秋无痕论坛常用软件全功能装机光盘
宋永志一键软件安装管理器
Embarcadero.Delphi.10.3.v26.0.32429.4364.Lite.v15.0
迅雷下载、福昕PDF阅读器、格式工厂、完美解码
321-复制常用AutoHotkey源代码脚本文件到文件夹D:\Program\AHKScripts\
322-复制其他常用的绿色免安装软件到D盘的Program文件夹的分类子文件夹中
323-复制华语音乐歌曲MP3、有声读物MP3、华语MV音乐歌曲MP4、完本小说CHM、照片图片jpg、国语中字华语电影rmvb、单机游戏exe、AutoHotkey脚本源代码和Delphi源代码DVD光盘ISO镜像等各种网络搜索下载资源共800GB的分类文件到本地磁盘D分区中。
324-设置Total Commander窗口字体大小和EditPath的Alt+D快捷键
///////////////////////////////////////
4-备份电脑软件和设置
401-复制DOS之家出品的“一键GHOST硬盘版.exe”到”C:\”
402-复制“雨过天晴电脑保护系统ygtq-MD5-C47.exe”到C:\
403-安装“一键GHOST硬盘版.exe”
404-用“一键GHOST硬盘版.exe”备份C盘操作系统到镜像文件\~1\C-PAN.GHO中
405-复制磁盘分区镜像文件\~1\C-PAN.GHO到移动硬盘
406-把两个移动硬盘分别锁在家中和单位里的第3号不锈钢保险柜中,并设置好保险柜的管理密码,录入各个手指的开锁指纹。
///////////////////////////////////////
5-保护电脑软件和设置
501-安装雨过天晴电脑保护系统ygtq-MD5-C47.exe
502-重启并测试“雨过天晴电脑保护系统ygtq-MD5-C47.exe”对操作系统还原保护的有效性。
503-拖放复制“cz880闪迪固态u盘128g”中的“01-办公文件”文件夹到电脑桌面并上传此文件夹到腾讯微云和天翼云盘网盘
504-拖放上传电脑中的其他重要文件到各大云存储网盘空间
505-及时打印重要文件并保存到不同的地点,防止误删丢失
///////////////////////////////////////
以下是使用说明和源代码备份区段,无需打印出来
电脑推荐购买14英寸的最新顶配轻薄笔记本电脑不要买台式机
“cz880闪迪固态u盘128g”用无缝焊接304不锈钢细链条与PAT512博友全不锈钢皮带钥匙扣连接,在使用U盘时用Z-TEK力特主动式USB3.0延长线5米连接电脑,严禁取下U盘使用,为了防止丢失U盘,U盘在使用时不离身。
;~ AHKManager.ahk
;AHK管理器AHKManager.ahk
;~ isShow:=true
;源码
;~ 按 {Ctrl} + {Alt} + {F12} 立即无条件终止所有脚本
Hotkey,^!F12,ExitThisApp
ExitThisApp()
{
gosub,ExitSubNow
ExitApp
}
;by Sixtyone At 2016.4.10
;更新说明
/*
2016.4.24:
1.运行#脚本后,gui自动隐藏;
2.启动脚本目录后,gui自动隐藏。
2016.4.17:
1. 增加过滤中使用%A_ScriptDir%变量。
2016.4.14:
1.修复2016.4.13版本中的1个bug;
2.添加文件(夹)过滤功能:添加到过滤中的文件(夹),将不会被读取到AHK管理器中;
3.修复之前版本某些脚本不能关闭问题;
4.修复脚本不能正确读取ini配置问题。
2016.4.13:
1.更新添加“Scripts文件夹内的第一层子文件夹脚本”,但所有脚本不能同名。
2016.4.11:
1.脚本库中启动条目后,焦点自带设置为上一条,正在运行库同;
2.更新脚本库双击运行脚本,正在运行库双击关闭脚本;
3.脚本库增加右键菜单:"编辑","运行"--正在运行库增加右键菜单:"编辑","重载","关闭"。
*/
#SingleInstance Force
#NoEnv
;#Warn
SetWorkingDir %A_ScriptDir%
Process, Priority,, High
DetectHiddenWindows,On
Menu, Tray, NoStandard ;删除自带托盘菜单
Menu, tray, add, 管理,ShowGui ; 显示Gui
Menu, tray, add ; 创建分隔线.
Menu, tray, add ,过滤,Menu_Tray_过滤 ; 过滤
Menu, tray, add ,脚本目录,Menu_Tray_OpenDir ; 脚本目录
Menu, tray, add ,重启管理器,Menu_Tray_Reload ; 重启
Menu, tray, Add
Menu, tray, Add,帮助,Help ;Help
Menu, tray, Add,关于,About ;关于
Menu, tray, Add
Menu, tray, Add, 退出, ExitSub ; 创建 退出
Menu, Tray, Default, 管理 ;;默认 菜单:配置
Menu, Tray, Icon, Shell32.dll, 258
;IntelligentScript:
Gui,Destroy
Gui Add, ListView, x8 y30 w200 h400 AltSubmit vScriptLibrary g运行 , 脚本名称
Gui Add, Text, x10 y3 w120 h23 +0x200, 脚本库
Gui Add, ListView, x233 y30 w200 h400 AltSubmit vScriptRun g运行2, 脚本名称
Gui Add, Text, x234 y3 w120 h23 +0x200, 已运行脚本
Gui Add, Button, x440 y30 w60 h42 gtsk_open, 启动脚本
Gui Add, Button, x440 y100 w60 h42 gtsk_restart, 重载脚本
Gui Add, Button, x440 y170 w60 h42 gtsk_close, 关闭脚本
Gui Add, Button, x440 y240 w60 h42 gMenu_Tray_OpenDir, 脚本目录
Gui Add, Button, x440 y310 w60 h42 gMenu_Tray_Reload, 重启管理器
Gui Add, Button, x440 y380 w60 h42 gExitSub, 退出
;Gui Show,, AHK管理器
Gui Default
Gui,ListView,ScriptLibrary
scriptCount = 0
IniRead,Golv,过滤.ini,过滤
OpenList := Array()
UnOpenList := Array()
FileCreateDir,%A_ScriptDir%\scripts
loop, %A_ScriptDir%\scripts\*.ahk,,1
{
_Golv=0
loop,Parse,Golv,`n,`r ;增加过滤判断
{
StringReplace,_GolvPath,A_LoopField,`%A_ScriptDir`%,%A_ScriptDir%
IfInString,A_LoopFileLongPath ,%_GolvPath%
{
_Golv=1
break
}
}
if _Golv=1
continue
if !(A_LoopFileLongPath~="i).+?\\scripts\\[^\\]*\\?[^\\]+\.ahk") ;增加一层子文件读取
continue
StringReplace, MenuName, A_LoopFileName, .ahk
scriptCount += 1
%MenuName%_Path :=A_LoopFileLongPath
%MenuName%_Dir :=A_LoopFileDir
scriptsName%scriptCount% := A_LoopFileName
;scriptsOpened%scriptCount% = 0
UnOpenList.Insert(MenuName)
}
InsertionSort(UnOpenList)
for Index, MenuName in UnOpenList
{
LV_Add("",MenuName)
}
LV_ModifyCol()
gosub tsk_openAll
;Gui,Show
return
运行:
if A_GuiEvent = DoubleClick
{
goto,tsk_open
}
return
运行2:
if A_GuiEvent = DoubleClick
goto,tsk_close
return
GuiContextMenu: ; 运行此标签来响应右键点击或按下 Appskey.
if A_GuiControl = ScriptLibrary ; 这个检查是可选的. 让它只为 ListView 中的点击显示菜单.
{
Gui,Default
Gui,ListView,ScriptLibrary
RowNumber = 0
loop,%scriptCount%
{
RowNumber := LV_GetNext(RowNumber)
if not RowNumber
return
break
}
Menu,PopC,Add,编辑,P_edit
Menu,PopC,Add,运行,tsk_open
Menu,PopC,Show
return
}
if A_GuiControl = ScriptRun
{
Gui,Default
Gui,ListView,ScriptRun
RowNumber = 0
loop,%scriptCount%
{
RowNumber := LV_GetNext(RowNumber)
if not RowNumber
return
break
}
Menu,PopC2,Add,编辑,P_edit
Menu,PopC2,Add,重载,tsk_restart
Menu,PopC2,Add,关闭,tsk_close
Menu,PopC2,Show
return
}
return
P_edit:
LV_GetText(thisScript, RowNumber)
P_editpath :=%thisScript%_path
Run, D:\Program\AutoHotkey\SciTE\SciTE.exe "%P_editpath%"
return
tsk_open:
Gui,Default
Gui,ListView,ScriptLibrary
RowNumber = 0
loop,%scriptCount%
{
RowNumber := LV_GetNext(RowNumber)
if not RowNumber
return
LV_GetText(thisScript, RowNumber)
Run,% %thisScript%_Path,% %thisScript%_Dir,,%thisScript%
IfInString, thisScript, #
{
Gui, Hide
return
}
;scriptsOpened%A_Index% := 1
break
}
Gui,ListView,ScriptRun
LV_Add("",ThisScript)
LV_ModifyCol()
Gui,ListView,ScriptLibrary
loop, %scriptCount%
{
LV_GetText(outputname,A_Index,1)
if (outputname=ThisScript)
{
LV_Delete(A_Index)
if A_Index<>1
{
LV_Modify(A_Index-1, "Select")
}
else
{
LV_Modify(1, "Select")
}
break
}
}
LV_ModifyCol()
return
tsk_close:
Gui,Default
Gui,ListView,ScriptRun
RowNumber = 0
loop,%scriptCount%
{
RowNumber := LV_GetNext(RowNumber)
if not RowNumber
return
LV_GetText(thisScript, RowNumber)
ID:=%thisScript%
WinClose, ahk_pid %ID%
IfWinExist,ahk_pid %ID%
Process,Close,%ID%
;scriptsOpened%A_Index% := 0
break
}
Gui,ListView,ScriptLibrary
LV_Add("",ThisScript)
LV_ModifyCol()
Gui,ListView,ScriptRun
loop, %scriptCount%
{
LV_GetText(outputname,A_Index,1)
if (outputname=thisScript)
{
LV_Delete(A_Index)
if A_Index<>1
{
LV_Modify(A_Index-1, "Select")
}
else
{
LV_Modify(1, "Select")
}
break
}
}
LV_ModifyCol()
return
tsk_restart:
Gui,Default
Gui,ListView,ScriptRun
RowNumber = 0
loop,%scriptCount%
{
RowNumber := LV_GetNext(RowNumber)
if not RowNumber
return
LV_GetText(thisScript, RowNumber)
ID:=%thisScript%
WinClose, ahk_pid %ID%
IfWinExist,ahk_pid %ID%
Process,Close,%ID%
Run,% %thisScript%_Path,% %thisScript%_Dir,,%thisScript%
break
}
return
tsk_openAll:
loop, %scriptCount%
{
thisScript := scriptsName%A_Index%
StringReplace, thisScript, thisScript, .ahk
;if scriptsOpened%A_Index% = 0
;{
IfInString, thisScript, _ ;IfInString,%thisScript%_Path,%A_ScriptDir%\Scripts\_ 不自动启动_文件夹内的脚本
{
continue
}
IfInString, thisScript, #
{
continue
}
Run, % %thisScript%_Path,% %thisScript%_Dir,,%thisScript%
;scriptsOpened%A_Index% = 1
Gui,Default
Gui,ListView,ScriptRun
LV_Add("",thisScript)
LV_ModifyCol()
Gui,ListView,ScriptLibrary
loop, %scriptCount%
{
LV_GetText(outputname,A_Index,1)
if (outputname=thisScript)
{
LV_Delete(A_Index)
break
}
}
LV_ModifyCol()
;}
}
;Gui,Show
return
Menu_Tray_过滤:
Run, Notepad.exe 过滤.ini
return
Menu_Tray_OpenDir:
FileCreateDir,%A_ScriptDir%\scripts
Run, %A_ScriptDir%\scripts
Gui,Hide
return
Menu_Tray_Reload:
Gui,Hide
Gui,Default
Gui,ListView,ScriptRun
loop % LV_GetCount()
{
LV_GetText(thisScript, A_Index)
ID:=%thisScript%
WinClose, ahk_pid %ID%
IfWinExist,ahk_pid %ID%
Process,Close,%ID%
}
Reload
return
GuiEscape:
GuiClose:
Gui, Hide
return
ExitSub:
MsgBox,260,是否退出?,退出脚本,将退出所有经过AHK管理器启动的脚本,你是否确认退出?
IfMsgBox No
return
ExitSubNow:
Gui,Hide
Gui,Default
Gui,ListView,ScriptRun
loop % LV_GetCount()
{
LV_GetText(thisScript, A_Index)
ID:=%thisScript%
WinClose, ahk_pid %ID%
IfWinExist,ahk_pid %ID%
Process,Close,%ID%
}
Gui,Destroy
ExitApp
return
InsertionSort(ByRef array)
{
target := Array()
count := 0
for Index, Files in array
{
files%Index% := Files
count += 1
}
j := 2
while (j <= count)
{
key := files%j%
i := j-1
while (i >= 0 && key < files%i%)
{
k := i+1
files%k% := files%i%
i -= 1
}
k := i+1
files%k% := key
j += 1
}
loop, %count%
{
target.Insert(files%A_Index%)
}
array := target
}
About:
MsgBox,AHK管理器`n版本号:2016.4.24`nCopyRight?2016 Sixtyone. All Rights Reserved.`n`n关于作者:`n`tName:Sixtyone`n`tQQ:576642385
return
Help:
MsgBox,将AHK脚本放在脚本目录下进行管理:`n1.以_开头的脚本不会自动加载`n2.以#开头的脚本为临时脚本即运行完就退出`n3.脚本名字不能有空格及除_、#以为的符号`n4.脚本不能为快捷方式
return
!F1::
;~ isShow:=!isShow
;~ if(isShow)
;~ {
ShowGui:
Gui,Show,,AHK管理器
;~ }
;~ else
;~ Gui,Hide
return
;~ 作者:sixtyone
;~ 链接:https://www.jianshu.com/p/d88f47fa431d
;~ 來源:简书
;~ 简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。
;
;===== 脚本结束 =====
///////////////////////////////////////
;~ %A_ScriptDir%\scripts\定时关闭广告窗口.ahk
;~ 定时自动关闭弹出广告窗口
;~ 请使用 AHK管理器AHKManager.ahk 管理和调用此脚本
SetTimer,设置此脚本的运行参数ConfigThisScript,-1000
SetTimer,关广告窗口删除广告文件,3000
return
;
关广告窗口删除广告文件()
{
WinHide, 向日葵远程控制 ahk_class SDL_app ahk_exe SunloginClient.exe,
WinHide, ahk_class TXGuiFoundation ahk_exe QQPCTray.exe,
WinClose,USB KEY PIN ahk_class #32770 ahk_exe Aisino.Framework.Startup.exe, 请输入KEY的PIN
WinHide,USB KEY PIN ahk_class #32770 ahk_exe Aisino.Framework.Startup.exe, 请输入KEY的PIN
; 请用 AHKInfo 1.3.5 窗口信息查询工具来获取窗口标题和窗口类名
WinClose, FF新推荐
WinClose,热点资讯
WinClose,ahk_class Q360RemindSClass ahk_exe 360Speedld.exe,
WinClose, ahk_class SGPopBubbleWindow ahk_exe SGTool.exe,
WinHide, ahk_class Suspension,
WinClose, 今日推荐
WinHide, 今日推荐
WinClose,USB KEY PIN ahk_class #32770 ahk_exe Aisino.Framework.Startup.exe, 请输入KEY的PIN
WinHide,USB KEY PIN ahk_class #32770 ahk_exe Aisino.Framework.Startup.exe, 请输入KEY的PIN
;~ Process,Close,Notepad.exe
;~ FileDelete,C:\abc\def.exe
}
设置此脚本的运行参数ConfigThisScript()
{
;当此脚本已经运行时自动替换旧实例再次运行。
#SingleInstance,force
;让脚本持久运行(即直到用户关闭或遇到 ExitApp)。
#Persistent
;不检查空变量是否为环境变量(建议所有新脚本使用)。
#NoEnv
;用强制的方法激活窗口。阻止任务栏按钮的闪烁.
#WinActivateForce
;不显示托盘图标。
#NoTrayIcon
;启用或禁用可能产生错误的特定状况时的警告,例如书写错误或缺少全局声明
;~ #Warn
;改变脚本的当前工作目录。
SetWorkingDir,%A_ScriptDir%
;设置脚本可以“看见”隐藏的窗口。
DetectHiddenWindows,On
;窗口标题匹配模式改成只需某个位置必须包含WinTitle。而不是完全匹配。
SetTitleMatchMode,2
;SendInput 通常更快更可靠. 缓存了发送期间任何物理的键盘或鼠标活动, 避免了在发送时夹杂用户的键击.
SendMode,Input
;要看源代码语句的解释请自己搜索AutoHotkey的CHM中文帮助文件吧,选中单词后按帮助快捷键 F1
CoordMode,Mouse,Screen
CoordMode,Pixel,Screen
CoordMode,ToolTip,Screen
ListLines,Off
SetBatchLines,-1
SetStoreCapsLockMode, On
;~ SetBatchLines,
;~ SetKeyDelay,
;~ SetWinDelay,
;~ SetControlDelay,
}
;
;===== 脚本结束 =====
///////////////////////////////////////
;~ %A_ScriptDir%\scripts\定时隐藏个人窗口可临时停止运行.ahk
;~ 定时隐藏个人窗口
;~ 请使用 AHK管理器AHKManager.ahk 管理和调用此脚本
SetTimer,设置此脚本的运行参数ConfigThisScript,-1000
SetTimer,定时隐藏个人窗口,3000
return
;
定时隐藏个人窗口()
{
;~ 隐藏迅雷下载软件的主窗口
WinHide, 迅雷 ahk_class Chrome_WidgetWin_0, Chrome Leg
;~ 隐藏迅雷下载软件的悬浮小窗口
;~ Process,Close,Notepad.exe
;~ FileDelete,C:\abc\def.exe
}
设置此脚本的运行参数ConfigThisScript()
{
;当此脚本已经运行时自动替换旧实例再次运行。
#SingleInstance,force
;让脚本持久运行(即直到用户关闭或遇到 ExitApp)。
#Persistent
;不检查空变量是否为环境变量(建议所有新脚本使用)。
#NoEnv
;用强制的方法激活窗口。阻止任务栏按钮的闪烁.
#WinActivateForce
;不显示托盘图标。
#NoTrayIcon
;启用或禁用可能产生错误的特定状况时的警告,例如书写错误或缺少全局声明
;~ #Warn
;改变脚本的当前工作目录。
SetWorkingDir,%A_ScriptDir%
;设置脚本可以“看见”隐藏的窗口。
DetectHiddenWindows,On
;窗口标题匹配模式改成只需某个位置必须包含WinTitle。而不是完全匹配。
SetTitleMatchMode,2
;SendInput 通常更快更可靠. 缓存了发送期间任何物理的键盘或鼠标活动, 避免了在发送时夹杂用户的键击.
SendMode,Input
;要看源代码语句的解释请自己搜索AutoHotkey的CHM中文帮助文件吧,选中单词后按帮助快捷键 F1
CoordMode,Mouse,Screen
CoordMode,Pixel,Screen
CoordMode,ToolTip,Screen
ListLines,Off
SetBatchLines,-1
SetStoreCapsLockMode, On
;~ SetBatchLines,
;~ SetKeyDelay,
;~ SetWinDelay,
;~ SetControlDelay,
}
;
;===== 脚本结束 =====
///////////////////////////////////////
;~ %A_ScriptDir%\scripts\设置常驻内存的程序加快窗口显示的速度.ahk
;
; 开机时自动启动的AutoHotkey脚本 2019年10月09日
;
; 计时器创建代码段 -----------------------------------------------------------------------------------------
; SetTimer可以模拟多线程从而不影响主线程的流畅执行
; 请在SciTE4AutoHotkey中选中单词并按快捷键F12跳转到函数定义处
; 绿色免安装程序,统一都分类保存在本地磁盘D分区文件夹 D:\DIYTOOLSram 中
; 例如: MasterSeeker就长期坚持固定不变保存位置在 D:\DIYTOOLSram\MasterSeeker\MasterSeeker.exe
; 例如: FileLocator Pro就长期坚持固定不变保存位置在 D:\DIYTOOLSram\FileLocator\FileLocator.exe
; #####################################################################
;
global ProgramDir
;~ ProgramDir=%A_ScriptDir%\..\..\..
ProgramDir=D:\Program
;~ SetTimer,01设置全局无窗口快捷键,-1000
; 请养成按<Win> + F 隐藏MasterSeeker窗口的习惯
SetTimer,12保持MasterSeeker窗口常驻内存,9000
SetTimer,13设置此脚本的运行参数,-1000
;~ SetTimer,14设置此脚本用户自定义变量,-1000
SetTimer,15防止重复运行此脚本,-1000
;~ SetTimer,16运行国税金税盘开票软件,-100
;~ SetTimer,17运行一些软件应用程序,-1000
;~ SetTimer,18关广告窗口删除广告文件,3000
; 设置插入当前日期和时间的热字串WT ( What is the time now )
::wt::
NowTimeString=%A_YYYY%年%A_MM%月%A_DD%日%A_Hour%时%A_Min%分
Clipboard=%NowTimeString%
Send ^v
return
return
;
; 此脚本相关信息说明段 ---------------------------------------------------------------------------------------
; 用法 把此AHK脚本文件复制到 “shell:startup”文件夹中
; shell:startup”文件夹一般位于开始菜单->所有程序->启动 文件夹
; 作者 徐晓亮 vlanweiyun618
; 电子邮箱地址 595076941@QQ.com
; 手机号码
;
; 函数子程序定义段 --------------------------------------------------------------------------------------------
;
01设置全局无窗口快捷键()
{
Hotkey,``,00打开随身U盘_办公专用盘
Hotkey,`#n,02激活或隐藏窗口EmEditor
Hotkey,`#e,03激活或隐藏窗口TotalCommander ; 按热键 Win+E 激活 TotalCommander
Hotkey,`#f,04激活或隐藏窗口MasterSeeker
Hotkey,`#g,05激活或隐藏窗口Everything
Hotkey,`#b,06激活或隐藏窗口SogouExplorer
Hotkey,`#c,07激活或隐藏窗口计算器Calc ; 按热键 Win + C,打开计算器
Hotkey,`^!E,08用SciTE4AutoHotkey编辑此脚本
Hotkey,`^!R,09重启此脚本
Hotkey,^F12,10终止此脚本执行 ;按Ctrl+Alt+F10键此脚本立即停止执行并退出
}
;
; ;智能命令,双击ALT执行
; Alt::
; if winc_presses > 0 ; SetTimer 已经启动, 所以我们记录键击.
; {
; winc_presses += 1
; return
; }
; ; 否则, 这是新开始系列中的首次按下. 把次数设为 1 并启动
; ; 计时器:
; winc_presses = 1
; SetTimer, KeyWinC, -400 ; 在 400 毫秒内等待更多的键击.
; return
;
; ;双击执行跳转
; KeyWinC:
; if winc_presses = 2 ; 此键按下了两次.
; {
; Gui, Show
;
; }
; ; 不论触发了上面的哪个动作, 都对 count 进行重置
; ; 为下一个系列的按下做准备:
; winc_presses = 0
; return
; 00打开随身U盘_办公专用盘()
; {
; 随身U盘的盘符:=搜索随身U盘并设置盘符()
; if (随身U盘的盘符<>0)
; { ToolTip
; FileCreateDir, %随身U盘的盘符%:\01_办公文件
; DetectHiddenWindows,On
; SetTitleMatchMode,2
; ;~ 需要设置一下系统,工具->文件夹选项->查看->在标题栏显示完整路径
; IfWinExist,9.22
; {
; WinShow,9.22
; WinActivate,9.22
; WinMaximize,9.22
; }
; else
; {
;
; IfExist,D:\Program\TotalCMD\TotalCMD.exe
; {
; Run,D:\Program\TotalCMD\TotalCMD.exe %随身U盘的盘符%:\01_办公文件
; }
; else
; MsgBox,找不到文件 D:\Program\TotalCMD\TotalCMD.exe
; ;~ Run,%随身U盘的盘符%:\01_办公文件
; }
; loop,5
; {
; WinMove,01_办公文件 ahk_class CabinetWClass,,A_ScreenWidth/2,0,A_ScreenWidth/2,A_ScreenHeight-35
; Sleep,100
; }
; }
; else
; ToolTip,没有找到随身U盘
; }
; ;
; ;
00打开随身U盘_办公专用盘()
{
随身U盘的盘符:=搜索随身U盘并设置盘符()
if (随身U盘的盘符<>0)
{ ToolTip
FileCreateDir, %随身U盘的盘符%:\01_办公文件
DetectHiddenWindows,On
SetTitleMatchMode,2
;~ 需要设置一下系统,工具->文件夹选项->查看->在标题栏显示完整路径
IfWinExist,,01_办公文件
{
WinShow,,01_办公文件
WinActivate,,01_办公文件
;~ WinMaximize,01_办公文件
}
else
{
Run,%随身U盘的盘符%:\01_办公文件
}
loop,5
{
WinMove,,01_办公文件,A_ScreenWidth/2,0,A_ScreenWidth/2,A_ScreenHeight-35
Sleep,100
}
}
else
ToolTip,没有找到随身U盘
SetTimer, RemoveToolTip, 5000
}
;
搜索随身U盘并设置盘符()
{ 找到U盘:=false
DriveGet,盘符清单,List
loop,Parse,盘符清单
{ DriveGet,卷标,Label,%A_LoopField%:
IfInString,卷标, 随身U盘
{ 找到U盘:=true
return,%A_LoopField%
} }
if (not 找到U盘)
{ return,0
} }
;
;
02激活或隐藏窗口EmEditor()
{
根据窗口类名激活或者隐藏窗口()
}
;
03激活或隐藏窗口TotalCommander()
{
根据窗口类名激活或者隐藏窗口("TotalCMD","TTOTAL_CMD")
}
;
04激活或隐藏窗口MasterSeeker()
{
根据窗口类名激活或者隐藏窗口("MasterSeeker","WindowsForms10.Window.8.app.0.218f99c")
;----- 全选激活MasterSeeker窗口的搜索编辑框:
loop,3
{
ControlFocus,Filename,ahk_class WindowsForms10.Window.8.app.0.218f99c
Sleep,10
ControlSend,Filename,{End},ahk_class WindowsForms10.Window.8.app.0.218f99c
}
Sleep,10
ControlSend,Filename,{ShiftDown}{Home}{ShiftUp},ahk_class WindowsForms10.Window.8.app.0.218f99c
Sleep,10
}
;
05激活或隐藏窗口Everything()
{
; 当窗口标题测试不通过的话只好用窗口类了
Process,Close,Everything.exe
根据窗口类名激活或者隐藏窗口("Everything","EVERYTHING")
}
;
06激活或隐藏窗口SogouExplorer()
{
ToolTip,正在启动搜狗高速浏览器_请稍候 . . .
SetTimer, RemoveToolTip, 5000
根据窗口类名激活或者隐藏窗口("SogouExplorer","SE_SogouExplorerFrame")
}
;
07激活或隐藏窗口计算器Calc()
{
Run,calc
}
;
08用SciTE4AutoHotkey编辑此脚本()
{
IfExist,%ProgramDir%\AutoHotkey\SciTE\SciTE.exe
Run,%ProgramDir%\AutoHotkey\SciTE\SciTE.exe %A_ScriptName%
else
{
ToolTip,找不到文件%ProgramDir%\AutoHotkey\SciTE\SciTE.exe
SetTimer, RemoveToolTip, 5000
Sleep,3000
}
}
;
09重启此脚本()
{
Reload
}
;
10终止此脚本执行()
{
ToolTip,%A_ScriptName% (即此脚本)已经退出
SetTimer, RemoveToolTip, 500
Sleep,500
ExitApp
}
;
12保持MasterSeeker窗口常驻内存()
{
Process,Exist,MasterSeeker.exe
if (%ErrorLevel%=0)
{
IfWinNotExist,MasterSeeker 1.5.1 by DxCK
{
IfWinNotExist,ahk_exe MasterSeeker.exe
{
IfExist,%ProgramDir%\MasterSeeker\MasterSeeker.exe
Run,%ProgramDir%\MasterSeeker\MasterSeeker.exe
WinWait,ahk_class WindowsForms10.Window.8.app.0.218f99c
loop,3
{
WinHide,ahk_class WindowsForms10.Window.8.app.0.218f99c
Sleep,100
}
}
}
}
}
;
13设置此脚本的运行参数()
{
#SingleInstance,force ;当此脚本已经运行时自动替换旧实例再次运行。
#Persistent ;让脚本持久运行(即直到用户关闭或遇到 ExitApp)。
#NoEnv ;不检查空变量是否为环境变量(建议所有新脚本使用)。
#WinActivateForce ;用强制的方法激活窗口。阻止任务栏按钮的闪烁.
;~ #NoTrayIcon ;不显示托盘图标。
;~ #Warn
SetWorkingDir,%A_ScriptDir% ;改变脚本的当前工作目录。
DetectHiddenWindows,On ;设置脚本可以“看见”隐藏的窗口。
SetTitleMatchMode,2 ;窗口标题匹配模式改成某个位置必须包含WinTitle。
SendMode,Input ;SendInput 通常更快更可靠. 缓存了发送期间任何物理的键盘或鼠标活动, 避免了在发送时夹杂用户的键击.
CoordMode,Mouse,Screen
CoordMode,Pixel,Screen
CoordMode,ToolTip,Screen
ListLines,Off
SetBatchLines,-1
SetStoreCapsLockMode, On
;~ SetBatchLines,
;~ SetKeyDelay,
;~ SetWinDelay,
;~ SetControlDelay,
}
;
14设置此脚本用户自定义变量()
{
;~ global 移动硬盘盘符 ;带冒号:
}
;
15防止重复运行此脚本()
{
#SingleInstance,force
loop,33
{
DetectHiddenWindows,On
Sleep,33
IfWinExist,QQ595076941_AutoRunAHK
ExitApp
}
Gui, Show, Hide,QQ595076941_AutoRunAHK
}
;
16运行国税金税盘开票软件()
{
SetTimer,运行开票软件,-500
SetTimer,激活登录窗口,500
SetTimer,单击登录窗口中的确定按钮,500
SetTimer,关闭上报汇总已成功提示窗口,500
SetTimer,等待主窗口出现后停止并删除所有Timer定时器,500
}
运行开票软件()
{
IfExist,D:\开票软件\MainExecute.exe
{
Process,Exist,Aisino.Framework.Startup.exe
if (%ErrorLevel%=0)
{
IfWinNotExist,SysMessageBox ahk_class WindowsForms10.Window.8.app.0.2bb23b_r11_ad1 ahk_exe Aisino.Framework.Startup.exe, 提示
{
IfWinNotExist,增值税发票税控开票软件
Run,D:\开票软件\MainExecute.exe
}
}
}
}
激活登录窗口()
{
WinGet, WinID, ID,税控发票开票软件
DllCall("SwitchToThisWindow", "UInt", WinID, "UInt", 1)
}
单击登录窗口中的确定按钮()
{
ControlClick, WindowsForms10.BUTTON.app.0.2bb23b_r11_ad12, 税控发票开票软件 ahk_class WindowsForms10.Window.8.app.0.2bb23b_r11_ad1 ahk_exe Aisino.Framework.Startup.exe, 增值税发票税控开票软
}
关闭上报汇总已成功提示窗口()
{
WinClose,SysMessageBox ahk_class WindowsForms10.Window.8.app.0.2bb23b_r11_ad1 ahk_exe Aisino.Framework.Startup.exe, 提示
}
等待主窗口出现后停止并删除所有Timer定时器()
{
;等待指定标题窗口出现
IfWinExist, 增值税发票税控开票软件(金税盘版) ahk_class WindowsForms10.Window.8.app.0.2bb23b_r11_ad1 ahk_exe Aisino.Framework.Startup.exe, 系统设置
停止并删除所有Timer定时器()
IfWinExist, 增值税发票税控开票软件(金税盘版) ahk_class WindowsForms10.Window.8.app.0.2bb23b_r11_ad1 ahk_exe Aisino.Framework.Startup.exe, 发票管理
停止并删除所有Timer定时器()
IfWinExist, 增值税发票税控开票软件(金税盘版) ahk_class WindowsForms10.Window.8.app.0.2bb23b_r11_ad1 ahk_exe Aisino.Framework.Startup.exe, 报税处理
停止并删除所有Timer定时器()
IfWinExist, 增值税发票税控开票软件(金税盘版) ahk_class WindowsForms10.Window.8.app.0.2bb23b_r11_ad1 ahk_exe Aisino.Framework.Startup.exe, 系统维护
停止并删除所有Timer定时器()
}
停止并删除所有Timer定时器()
{
SetTimer,运行开票软件,Delete
SetTimer,激活登录窗口,Delete
SetTimer,单击登录窗口中的确定按钮,Delete
SetTimer,关闭上报汇总已成功提示窗口,Delete
SetTimer,等待主窗口出现后停止并删除所有Timer定时器,Delete
;~ MsgBox,开票软件启动成功
Run,C:\Windows\System32\Rundll32.Exe user32.dll LockWorkStation,,Hide
}
;
17运行一些软件应用程序()
{
SetTimer,定时重启向日葵远程控制保持远程访问可用,3600000
IfExistRun("WiseDesktop") ; WiseDesktop 1.3 虚拟桌面管理程序
;~ IfExistRun("Rolan")
IfExistRun("PCOff") ;定时强制关机精灵1.0 在 17:05 下班后定时强制关闭电脑
SetTimer,超时锁定桌面,30000
;~ Run,"D:\DIYTOOLS\AHKManage\AHKManage.ahk"
;~ FileCreateShortcut,http://www.weiyun.com,%A_DesktopCommon%\微云网页版.lnk
; D:\DIYTOOLS\AutoHotkey\SciTE 文件夹用于保存AHK脚本编辑器程序,此程序可用uTools搜索并运行
FileCreateDir,D:\DIYTOOLS\AutoHotkey\SciTE
; D:\DIYTOOLS\MasterSeeker 文件夹用于保存MasterSeeker程序,此程序需要微软的dotNetFx2.0运行库支持才能运行
FileCreateDir,D:\DIYTOOLS\MasterSeeker
; D:\DIYTOOLS\AutoRun 文件夹用于保存开机自动启动的AHK脚本
FileCreateDir,D:\DIYTOOLS\AutoRun
; D:\DIYTOOLS\uTools\lnks 文件夹用于保存uTools的自定义快捷方式,可用uTools缓存和搜索快捷方式,网址可以保存在批处理脚本的快捷方式中
FileCreateDir,D:\DIYTOOLS\uTools\lnks
}
;
定时重启向日葵远程控制保持远程访问可用()
{
loop,9
{
;~ WinMove
;~ WinMaximize
;~ WinHide
;~ WinClose
;~ WinKill
;~ Process,Close,
;~ WinGet, active_id, PID, A
;~ run, taskkill /PID %active_id% /F,,Hide
;~ Run, Target [, WorkingDir, Max|Min|Hide|UseErrorLevel, OutputVarPID]
;~ 要想得到pid, 需要把WorkingDir的参数置空,否则就得不到,真是坑爹
Sleep,500
WinClose, 桌面控制 ahk_class SDL_app ahk_exe SunloginClient.exe,
Sleep,500
WinKill, 桌面控制 ahk_class SDL_app ahk_exe SunloginClient.exe,
Sleep,500
Process,Close,SunloginClient.exe
}
loop,2
{
Sleep,3000
IfExist,"C:\Program Files\Oray\SunLogin\SunloginClient\SunloginClient.exe"
Run,"C:\Program Files\Oray\SunLogin\SunloginClient\SunloginClient.exe"
}
}
;
超时锁定桌面()
{
if(A_TimeIdle>50000)
{
if(A_TimeIdlePhysical>50000)
{
Run,C:\Windows\System32\Rundll32.Exe user32.dll LockWorkStation,,Hide
SendMessage, 0x112, 0xF170, 2,, Program Manager ; 关闭显示器: 0x112 为 WM_SYSCOMMAND, 0xF170 为 SC_MONITORPOWER. ; 可使用 -1 代替 2 打开显示器,1 代替 2 激活显示器的节能模式
}
}
}
18关广告窗口删除广告文件()
{
;等待指定标题窗口出现
WinHide, USB KEY PIN ahk_class #32770 ahk_exe Aisino.Framework.Startup.exe, 请输入KEY的PIN
WinClose, USB KEY PIN ahk_class #32770 ahk_exe Aisino.Framework.Startup.exe, 请输入KEY的PIN
;等待指定标题窗口出现
WinHide, ahk_class TXGuiFoundation ahk_exe QQPCTray.exe,
WinClose, Microsoft Windows ahk_class #32770, 稍后重新启动(&L)
WinClose, ahk_class TXGuiFoundation ahk_exe QQPCTray.exe,
WinClose,头条新闻
WinClose,向日葵远程控制 ahk_class SDL_app,
WinClose,今日热点 ahk_class SGNewsWindow,
WinClose,到期抄报税提示 ahk_class WindowsForms10.Window.8.app.0.2bb23b_r11_ad1 ahk_exe Aisino.Framework.Startup.exe,
; 请用 AHKInfo 1.3.5 窗口信息查询工具来获取窗口标题和窗口类名
;~ 广告弹窗专杀语句格式 WinClose,ahk_exe SohuNews.exe
;~ ;; ;; xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
;~ WinClose,ahk_exe
;~ WinClose,USB KEY PIN,请输入KEY的PIN码
;~ WinClose,ahk_exe QQPCSoftTrayTips.exe
;~ WinClose,ahk_exe QQPCTray.exe
;~ WinClose,ahk_exe SohuNews.exe
;~ WinClose,ahk_exe SGTool.exe
;~ WinClose,ahk_exe PicFaceTool.exe
;~ WinClose,ahk_exe wpscEnter.exe
;~ WinClose,ahk_exe WindowsForms10.Window.20008.app.0.261f82a_r13_ad1
;~ WinClose,ahk_exe AutoShow.exe
;~ WinClose,ahk_exe skinbox.exe
;~ WinClose,ahk_exe WnComMgr.exe
;~ WinClose,ahk_exe WnMoniter.exe
;~ WinClose,ahk_exe WnHelper64.exe
;~ WinClose,ahk_exe WnUserPage.exe
;~ WinClose,ahk_class TXGuiFoundation
;~ WinClose,到期抄报税提示
;~ WinClose,USB KEY PIN,请输入KEY的PIN码
;等待指定标题窗口出现
;~ WinClose,FF新推荐 ahk_class #32770,
}
;
; 请使用 窗口信息工具 AHKInfo 1.3.5 获取窗口的类名
根据窗口类名激活或者隐藏窗口(VarExeFileName:="EmEditor",VarWinClassName:="EmEditorMainFrame3")
{
; 1、如果程序没有运行则运行程序
Process,Exist,%VarExeFileName%.exe
if (%ErrorLevel%=0)
{
IfExist,%ProgramDir%\%VarExeFileName%\%VarExeFileName%.exe
{
Run,%ProgramDir%\%VarExeFileName%\%VarExeFileName%.exe
return
}
else
{
MsgBox,找不到文件 %ProgramDir%\%VarExeFileName%\%VarExeFileName%.exe
return
}
}
; 2、如果窗口未置顶则显示并激活(切换到)指定窗口
IfWinNotActive,ahk_class %VarWinClassName%
{
loop,3
{
WinShow,ahk_class %VarWinClassName%
WinMaximize,ahk_class %VarWinClassName%
WinGet, WinID, ID,ahk_class %VarWinClassName%
DllCall("SwitchToThisWindow", "UInt", WinID, "UInt", 1)
}
return
}
; 3、如果窗口已经显示并置顶则隐藏窗口
;~ WinMinimize,ahk_class %VarWinClassName%
WinHide,ahk_class %VarWinClassName%
}
IfExistRun(TargetEXE) ;检查文件是否存在并运行程序
{
IfExist,%ProgramDir%\%TargetEXE%\%TargetEXE%.exe
Run,%ProgramDir%\%TargetEXE%\%TargetEXE%.exe
else
{
ToolTip,未找到文件%ProgramDir%\%TargetEXE%\%TargetEXE%.exe
SetTimer, RemoveToolTip, 5000
}
}
RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
return
;
;===== 脚本结束 =====
///////////////////////////////////////
;~ %A_ScriptDir%\scripts\设置随系统启动的程序.ahk
#SingleInstance,force ;当此脚本已经运行时自动替换旧实例再次运行。
#Persistent ;让脚本持久运行(即直到用户关闭或遇到 ExitApp)。
#NoEnv ;不检查空变量是否为环境变量(建议所有新脚本使用)。
#WinActivateForce ;用强制的方法激活窗口。阻止任务栏按钮的闪烁.
;~ #NoTrayIcon ;不显示托盘图标。
;~ #Warn
SetWorkingDir,%A_ScriptDir% ;改变脚本的当前工作目录。
DetectHiddenWindows,On ;设置脚本可以“看见”隐藏的窗口。
SetTitleMatchMode,2 ;窗口标题匹配模式改成某个位置必须包含WinTitle。
IfExist,% "D:\Program\WiseDesktop\WiseDesktop.exe"
Run,% "D:\Program\WiseDesktop\WiseDesktop.exe"
IfExist,% "C:\Program Files (x86)\USB Safely Remove\USBSafelyRemove.exe"
Run,% "C:\Program Files (x86)\USB Safely Remove\USBSafelyRemove.exe"
SetTimer,16运行国税金税盘开票软件,-100
return
16运行国税金税盘开票软件()
{
SetTimer,运行开票软件,-500
SetTimer,激活登录窗口,500
SetTimer,单击登录窗口中的确定按钮,500
SetTimer,关闭上报汇总已成功提示窗口,500
SetTimer,等待主窗口出现后停止并删除所有Timer定时器,500
}
运行开票软件()
{
IfExist,D:\开票软件\MainExecute.exe
{
Process,Exist,Aisino.Framework.Startup.exe
if (%ErrorLevel%=0)
{
IfWinNotExist,SysMessageBox ahk_class WindowsForms10.Window.8.app.0.2bb23b_r11_ad1 ahk_exe Aisino.Framework.Startup.exe, 提示
{
IfWinNotExist,增值税发票税控开票软件
Run,D:\开票软件\MainExecute.exe
}
}
}
}
激活登录窗口()
{
WinGet, WinID, ID,税控发票开票软件
DllCall("SwitchToThisWindow", "UInt", WinID, "UInt", 1)
}
单击登录窗口中的确定按钮()
{
ControlClick, WindowsForms10.BUTTON.app.0.2bb23b_r11_ad12, 税控发票开票软件 ahk_class WindowsForms10.Window.8.app.0.2bb23b_r11_ad1 ahk_exe Aisino.Framework.Startup.exe, 增值税发票税控开票软
ControlClick, WindowsForms10.BUTTON.app.0.1ed9395_r12_ad12, 税控发票开票软件 ahk_class WindowsForms10.Window.8.app.0.1ed9395_r12_ad1 ahk_exe Aisino.Framework.Startup.exe, 增值税发票税控开票软
}
关闭上报汇总已成功提示窗口()
{
WinClose,SysMessageBox ahk_class WindowsForms10.Window.8.app.0.2bb23b_r11_ad1 ahk_exe Aisino.Framework.Startup.exe, 提示
}
等待主窗口出现后停止并删除所有Timer定时器()
{
;等待指定标题窗口出现
IfWinExist, SysMessageBox ahk_exe Aisino.Framework.Startup.exe, 登录错误
停止并删除所有Timer定时器()
IfWinExist,增值税发票税控开票软件(金税盘版) V2 ahk_exe Aisino.Framework.Startup.exe
停止并删除所有Timer定时器()
}
停止并删除所有Timer定时器()
{
SetTimer,运行开票软件,Delete
SetTimer,激活登录窗口,Delete
SetTimer,单击登录窗口中的确定按钮,Delete
SetTimer,关闭上报汇总已成功提示窗口,Delete
SetTimer,等待主窗口出现后停止并删除所有Timer定时器,Delete
;~ MsgBox,开票软件启动成功
Run,C:\Windows\System32\Rundll32.Exe user32.dll LockWorkStation,,Hide
}
;
ExitApp
;
;===== 脚本结束 =====
///////////////////////////////////////
;~ %A_ScriptDir%\scripts\无窗口全局热键定义.ahk
;
; 开机时自动启动的AutoHotkey脚本 2019年10月09日
;
; 计时器创建代码段 -----------------------------------------------------------------------------------------
; SetTimer可以模拟多线程从而不影响主线程的流畅执行
; 请在SciTE4AutoHotkey中选中单词并按快捷键F12跳转到函数定义处
; 绿色免安装程序,统一都分类保存在本地磁盘D分区文件夹 D:\DIYTOOLSram 中
; 例如: MasterSeeker就长期坚持固定不变保存位置在 D:\DIYTOOLSram\MasterSeeker\MasterSeeker.exe
; 例如: FileLocator Pro就长期坚持固定不变保存位置在 D:\DIYTOOLSram\FileLocator\FileLocator.exe
; #####################################################################
;
global ProgramDir
;~ ProgramDir=%A_ScriptDir%\..\..\..
ProgramDir=D:\Program
SetTimer,01设置全局无窗口快捷键,-1000
; 请养成按<Win> + F 隐藏MasterSeeker窗口的习惯
;~ SetTimer,12保持MasterSeeker窗口常驻内存,9000
SetTimer,13设置此脚本的运行参数,-1000
SetTimer,14设置此脚本用户自定义变量,-1000
SetTimer,15防止重复运行此脚本,-1000
;~ SetTimer,16运行国税金税盘开票软件,-100
;~ SetTimer,17运行一些软件应用程序,-1000
;~ SetTimer,18关广告窗口删除广告文件,3000
; 设置插入当前日期和时间的热字串WT ( What is the time now )
::wt::
NowTimeString=%A_YYYY%年%A_MM%月%A_DD%日%A_Hour%时%A_Min%分
Clipboard=%NowTimeString%
Send ^v
return
return
;
; 此脚本相关信息说明段 ---------------------------------------------------------------------------------------
; 用法 把此AHK脚本文件复制到 “shell:startup”文件夹中
; shell:startup”文件夹一般位于开始菜单->所有程序->启动 文件夹
; 作者 徐晓亮 vlanweiyun618
; 电子邮箱地址 595076941@QQ.com
; 手机号码
;
; 函数子程序定义段 --------------------------------------------------------------------------------------------
;
01设置全局无窗口快捷键()
{
Hotkey,``,00打开随身U盘_办公专用盘
Hotkey,`#n,02激活或隐藏窗口EmEditor
Hotkey,`#e,03激活或隐藏窗口TotalCommander ; 按热键 Win+E 激活 TotalCommander
Hotkey,`#f,04激活或隐藏窗口MasterSeeker
Hotkey,`#g,05激活或隐藏窗口Everything
Hotkey,`#b,06激活或隐藏窗口SogouExplorer
Hotkey,`#c,07激活或隐藏窗口计算器Calc ; 按热键 Win + C,打开计算器
Hotkey,`^!E,08用SciTE4AutoHotkey编辑此脚本
Hotkey,`^!R,09重启此脚本
Hotkey,^F12,10终止此脚本执行 ;按Ctrl+Alt+F10键此脚本立即停止执行并退出
}
;
; ;智能命令,双击ALT执行
; Alt::
; if winc_presses > 0 ; SetTimer 已经启动, 所以我们记录键击.
; {
; winc_presses += 1
; return
; }
; ; 否则, 这是新开始系列中的首次按下. 把次数设为 1 并启动
; ; 计时器:
; winc_presses = 1
; SetTimer, KeyWinC, -400 ; 在 400 毫秒内等待更多的键击.
; return
;
; ;双击执行跳转
; KeyWinC:
; if winc_presses = 2 ; 此键按下了两次.
; {
; Gui, Show
;
; }
; ; 不论触发了上面的哪个动作, 都对 count 进行重置
; ; 为下一个系列的按下做准备:
; winc_presses = 0
; return
; 00打开随身U盘_办公专用盘()
; {
; 随身U盘的盘符:=搜索随身U盘并设置盘符()
; if (随身U盘的盘符<>0)
; { ToolTip
; FileCreateDir, %随身U盘的盘符%:\01-办公文件
; DetectHiddenWindows,On
; SetTitleMatchMode,2
; ;~ 需要设置一下系统,工具->文件夹选项->查看->在标题栏显示完整路径
; IfWinExist,9.22
; {
; WinShow,9.22
; WinActivate,9.22
; WinMaximize,9.22
; }
; else
; {
;
; IfExist,D:\Program\TotalCMD\TotalCMD.exe
; {
; Run,D:\Program\TotalCMD\TotalCMD.exe %随身U盘的盘符%:\01-办公文件
; }
; else
; MsgBox,找不到文件 D:\Program\TotalCMD\TotalCMD.exe
; ;~ Run,%随身U盘的盘符%:\01-办公文件
; }
; loop,5
; {
; WinMove,01-办公文件 ahk_class CabinetWClass,,A_ScreenWidth/2,0,A_ScreenWidth/2,A_ScreenHeight-35
; Sleep,100
; }
; }
; else
; ToolTip,没有找到随身U盘
; SetTimer, RemoveToolTip, 5000
; }
; ;
; ;
00打开随身U盘_办公专用盘()
{
随身U盘的盘符:=搜索随身U盘并设置盘符()
if (随身U盘的盘符<>0)
{ SetTimer, RemoveToolTip, 5000
FileCreateDir, %随身U盘的盘符%:\01-办公文件
DetectHiddenWindows,On
SetTitleMatchMode,2
;~ 需要设置一下系统,工具->文件夹选项->查看->在标题栏显示完整路径
IfWinExist,,01-办公文件
{
WinShow,,01-办公文件
WinActivate,,01-办公文件
;~ WinMaximize,01-办公文件
}
else
{
Run,%随身U盘的盘符%:\01-办公文件
}
loop,5
{
WinMove,,01-办公文件,A_ScreenWidth/2,0,A_ScreenWidth/2,A_ScreenHeight-35
Sleep,100
}
}
else
ToolTip,没有找到随身U盘
SetTimer, RemoveToolTip, 5000
}
;
;
搜索随身U盘并设置盘符()
{ 找到U盘:=false
DriveGet,盘符清单,List
loop,Parse,盘符清单
{ DriveGet,卷标,Label,%A_LoopField%:
IfInString,卷标, 随身固态U盘
{ 找到U盘:=true
return,%A_LoopField%
} }
if (not 找到U盘)
{ return,0
} }
;
;
02激活或隐藏窗口EmEditor()
{
根据窗口类名激活或者隐藏窗口()
}
;
03激活或隐藏窗口TotalCommander()
{
根据窗口类名激活或者隐藏窗口("TotalCMD","TTOTAL_CMD")
}
;
04激活或隐藏窗口MasterSeeker()
{
根据窗口类名激活或者隐藏窗口("MasterSeeker","WindowsForms10.Window.8.app.0.218f99c")
;----- 全选激活MasterSeeker窗口的搜索编辑框:
loop,3
{
ControlFocus,Filename,ahk_class WindowsForms10.Window.8.app.0.218f99c
Sleep,10
ControlSend,Filename,{End},ahk_class WindowsForms10.Window.8.app.0.218f99c
}
Sleep,10
ControlSend,Filename,{ShiftDown}{Home}{ShiftUp},ahk_class WindowsForms10.Window.8.app.0.218f99c
Sleep,10
}
;
05激活或隐藏窗口Everything()
{
; 当窗口标题测试不通过的话只好用窗口类了
Process,Close,Everything.exe
根据窗口类名激活或者隐藏窗口("Everything","EVERYTHING")
}
;
06激活或隐藏窗口SogouExplorer()
{
ToolTip,正在启动搜狗高速浏览器_请稍候 . . .
根据窗口类名激活或者隐藏窗口("SogouExplorer","SE_SogouExplorerFrame")
}
;
07激活或隐藏窗口计算器Calc()
{
Run,calc
}
;
08用SciTE4AutoHotkey编辑此脚本()
{
IfExist,%ProgramDir%\AutoHotkey\SciTE\SciTE.exe
Run,%ProgramDir%\AutoHotkey\SciTE\SciTE.exe %A_ScriptName%
else
{
ToolTip,找不到文件%ProgramDir%\AutoHotkey\SciTE\SciTE.exe ,% A_ScreenWidth/2-150,% A_ScreenHeight/2-150
SetTimer, RemoveToolTip, 5000
Sleep,3000
}
}
;
09重启此脚本()
{
Reload
}
;
10终止此脚本执行()
{
ToolTip,%A_ScriptName% (即此脚本)已经退出
SetTimer, RemoveToolTip, 500
Sleep,500
ExitApp
}
;
12保持MasterSeeker窗口常驻内存()
{
Process,Exist,MasterSeeker.exe
if (%ErrorLevel%=0)
{
IfWinNotExist,MasterSeeker 1.5.1 by DxCK
{
IfWinNotExist,ahk_exe MasterSeeker.exe
{
IfExist,%ProgramDir%\MasterSeeker\MasterSeeker.exe
Run,%ProgramDir%\MasterSeeker\MasterSeeker.exe
WinWait,ahk_class WindowsForms10.Window.8.app.0.218f99c
loop,3
{
WinHide,ahk_class WindowsForms10.Window.8.app.0.218f99c
Sleep,100
}
}
}
}
}
;
13设置此脚本的运行参数()
{
#SingleInstance,force ;当此脚本已经运行时自动替换旧实例再次运行。
#Persistent ;让脚本持久运行(即直到用户关闭或遇到 ExitApp)。
#NoEnv ;不检查空变量是否为环境变量(建议所有新脚本使用)。
#WinActivateForce ;用强制的方法激活窗口。阻止任务栏按钮的闪烁.
;~ #NoTrayIcon ;不显示托盘图标。
;~ #Warn
SetWorkingDir,%A_ScriptDir% ;改变脚本的当前工作目录。
DetectHiddenWindows,On ;设置脚本可以“看见”隐藏的窗口。
SetTitleMatchMode,2 ;窗口标题匹配模式改成某个位置必须包含WinTitle。
SendMode,Input ;SendInput 通常更快更可靠. 缓存了发送期间任何物理的键盘或鼠标活动, 避免了在发送时夹杂用户的键击.
CoordMode,Mouse,Screen
CoordMode,Pixel,Screen
CoordMode,ToolTip,Screen
ListLines,Off
SetBatchLines,-1
SetStoreCapsLockMode, On
;~ SetBatchLines,
;~ SetKeyDelay,
;~ SetWinDelay,
;~ SetControlDelay,
}
;
14设置此脚本用户自定义变量()
{
;~ global 移动硬盘盘符 ;带冒号:
}
;
15防止重复运行此脚本()
{
#SingleInstance,force
loop,33
{
DetectHiddenWindows,On
Sleep,33
IfWinExist,QQ595076941_AutoRunAHK
ExitApp
}
Gui, Show, Hide,QQ595076941_AutoRunAHK
}
;
16运行国税金税盘开票软件()
{
SetTimer,运行开票软件,-500
SetTimer,激活登录窗口,500
SetTimer,单击登录窗口中的确定按钮,500
SetTimer,关闭上报汇总已成功提示窗口,500
SetTimer,等待主窗口出现后停止并删除所有Timer定时器,500
}
运行开票软件()
{
IfExist,D:\开票软件\MainExecute.exe
{
Process,Exist,Aisino.Framework.Startup.exe
if (%ErrorLevel%=0)
{
IfWinNotExist,SysMessageBox ahk_class WindowsForms10.Window.8.app.0.2bb23b_r11_ad1 ahk_exe Aisino.Framework.Startup.exe, 提示
{
IfWinNotExist,增值税发票税控开票软件
Run,D:\开票软件\MainExecute.exe
}
}
}
}
激活登录窗口()
{
WinGet, WinID, ID,税控发票开票软件
DllCall("SwitchToThisWindow", "UInt", WinID, "UInt", 1)
}
单击登录窗口中的确定按钮()
{
ControlClick, WindowsForms10.BUTTON.app.0.2bb23b_r11_ad12, 税控发票开票软件 ahk_class WindowsForms10.Window.8.app.0.2bb23b_r11_ad1 ahk_exe Aisino.Framework.Startup.exe, 增值税发票税控开票软
}
关闭上报汇总已成功提示窗口()
{
WinClose,SysMessageBox ahk_class WindowsForms10.Window.8.app.0.2bb23b_r11_ad1 ahk_exe Aisino.Framework.Startup.exe, 提示
}
等待主窗口出现后停止并删除所有Timer定时器()
{
;等待指定标题窗口出现
IfWinExist, 增值税发票税控开票软件(金税盘版) ahk_class WindowsForms10.Window.8.app.0.2bb23b_r11_ad1 ahk_exe Aisino.Framework.Startup.exe, 系统设置
停止并删除所有Timer定时器()
IfWinExist, 增值税发票税控开票软件(金税盘版) ahk_class WindowsForms10.Window.8.app.0.2bb23b_r11_ad1 ahk_exe Aisino.Framework.Startup.exe, 发票管理
停止并删除所有Timer定时器()
IfWinExist, 增值税发票税控开票软件(金税盘版) ahk_class WindowsForms10.Window.8.app.0.2bb23b_r11_ad1 ahk_exe Aisino.Framework.Startup.exe, 报税处理
停止并删除所有Timer定时器()
IfWinExist, 增值税发票税控开票软件(金税盘版) ahk_class WindowsForms10.Window.8.app.0.2bb23b_r11_ad1 ahk_exe Aisino.Framework.Startup.exe, 系统维护
停止并删除所有Timer定时器()
}
停止并删除所有Timer定时器()
{
SetTimer,运行开票软件,Delete
SetTimer,激活登录窗口,Delete
SetTimer,单击登录窗口中的确定按钮,Delete
SetTimer,关闭上报汇总已成功提示窗口,Delete
SetTimer,等待主窗口出现后停止并删除所有Timer定时器,Delete
;~ MsgBox,开票软件启动成功
Run,C:\Windows\System32\Rundll32.Exe user32.dll LockWorkStation,,Hide
}
;
17运行一些软件应用程序()
{
SetTimer,定时重启向日葵远程控制保持远程访问可用,3600000
IfExistRun("WiseDesktop") ; WiseDesktop 1.3 虚拟桌面管理程序
;~ IfExistRun("Rolan")
IfExistRun("PCOff") ;定时强制关机精灵1.0 在 17:05 下班后定时强制关闭电脑
SetTimer,超时锁定桌面,30000
;~ Run,"D:\DIYTOOLS\AHKManage\AHKManage.ahk"
;~ FileCreateShortcut,http://www.weiyun.com,%A_DesktopCommon%\微云网页版.lnk
; D:\DIYTOOLS\AutoHotkey\SciTE 文件夹用于保存AHK脚本编辑器程序,此程序可用uTools搜索并运行
FileCreateDir,D:\DIYTOOLS\AutoHotkey\SciTE
; D:\DIYTOOLS\MasterSeeker 文件夹用于保存MasterSeeker程序,此程序需要微软的dotNetFx2.0运行库支持才能运行
FileCreateDir,D:\DIYTOOLS\MasterSeeker
; D:\DIYTOOLS\AutoRun 文件夹用于保存开机自动启动的AHK脚本
FileCreateDir,D:\DIYTOOLS\AutoRun
; D:\DIYTOOLS\uTools\lnks 文件夹用于保存uTools的自定义快捷方式,可用uTools缓存和搜索快捷方式,网址可以保存在批处理脚本的快捷方式中
FileCreateDir,D:\DIYTOOLS\uTools\lnks
}
;
定时重启向日葵远程控制保持远程访问可用()
{
loop,9
{
;~ WinMove
;~ WinMaximize
;~ WinHide
;~ WinClose
;~ WinKill
;~ Process,Close,
;~ WinGet, active_id, PID, A
;~ run, taskkill /PID %active_id% /F,,Hide
;~ Run, Target [, WorkingDir, Max|Min|Hide|UseErrorLevel, OutputVarPID]
;~ 要想得到pid, 需要把WorkingDir的参数置空,否则就得不到,真是坑爹
Sleep,500
WinClose, 桌面控制 ahk_class SDL_app ahk_exe SunloginClient.exe,
Sleep,500
WinKill, 桌面控制 ahk_class SDL_app ahk_exe SunloginClient.exe,
Sleep,500
Process,Close,SunloginClient.exe
}
loop,2
{
Sleep,3000
IfExist,"C:\Program Files\Oray\SunLogin\SunloginClient\SunloginClient.exe"
Run,"C:\Program Files\Oray\SunLogin\SunloginClient\SunloginClient.exe"
}
}
;
超时锁定桌面()
{
if(A_TimeIdle>50000)
{
if(A_TimeIdlePhysical>50000)
{
Run,C:\Windows\System32\Rundll32.Exe user32.dll LockWorkStation,,Hide
SendMessage, 0x112, 0xF170, 2,, Program Manager ; 关闭显示器: 0x112 为 WM_SYSCOMMAND, 0xF170 为 SC_MONITORPOWER. ; 可使用 -1 代替 2 打开显示器,1 代替 2 激活显示器的节能模式
}
}
}
18关广告窗口删除广告文件()
{
;等待指定标题窗口出现
WinHide, USB KEY PIN ahk_class #32770 ahk_exe Aisino.Framework.Startup.exe, 请输入KEY的PIN
WinClose, USB KEY PIN ahk_class #32770 ahk_exe Aisino.Framework.Startup.exe, 请输入KEY的PIN
;等待指定标题窗口出现
WinHide, ahk_class TXGuiFoundation ahk_exe QQPCTray.exe,
WinClose, Microsoft Windows ahk_class #32770, 稍后重新启动(&L)
WinClose, ahk_class TXGuiFoundation ahk_exe QQPCTray.exe,
WinClose,头条新闻
WinClose,向日葵远程控制 ahk_class SDL_app,
WinClose,今日热点 ahk_class SGNewsWindow,
WinClose,到期抄报税提示 ahk_class WindowsForms10.Window.8.app.0.2bb23b_r11_ad1 ahk_exe Aisino.Framework.Startup.exe,
; 请用 AHKInfo 1.3.5 窗口信息查询工具来获取窗口标题和窗口类名
;~ 广告弹窗专杀语句格式 WinClose,ahk_exe SohuNews.exe
;~ ;; ;; xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
;~ WinClose,ahk_exe
;~ WinClose,USB KEY PIN,请输入KEY的PIN码
;~ WinClose,ahk_exe QQPCSoftTrayTips.exe
;~ WinClose,ahk_exe QQPCTray.exe
;~ WinClose,ahk_exe SohuNews.exe
;~ WinClose,ahk_exe SGTool.exe
;~ WinClose,ahk_exe PicFaceTool.exe
;~ WinClose,ahk_exe wpscEnter.exe
;~ WinClose,ahk_exe WindowsForms10.Window.20008.app.0.261f82a_r13_ad1
;~ WinClose,ahk_exe AutoShow.exe
;~ WinClose,ahk_exe skinbox.exe
;~ WinClose,ahk_exe WnComMgr.exe
;~ WinClose,ahk_exe WnMoniter.exe
;~ WinClose,ahk_exe WnHelper64.exe
;~ WinClose,ahk_exe WnUserPage.exe
;~ WinClose,ahk_class TXGuiFoundation
;~ WinClose,到期抄报税提示
;~ WinClose,USB KEY PIN,请输入KEY的PIN码
;等待指定标题窗口出现
;~ WinClose,FF新推荐 ahk_class #32770,
}
;
; 请使用 窗口信息工具 AHKInfo 1.3.5 获取窗口的类名
根据窗口类名激活或者隐藏窗口(VarExeFileName:="EmEditor",VarWinClassName:="EmEditorMainFrame3")
{
; 1、如果程序没有运行则运行程序
Process,Exist,%VarExeFileName%.exe
if (%ErrorLevel%=0)
{
IfExist,%ProgramDir%\%VarExeFileName%\%VarExeFileName%.exe
{
Run,%ProgramDir%\%VarExeFileName%\%VarExeFileName%.exe
return
}
else
{
MsgBox,找不到文件 %ProgramDir%\%VarExeFileName%\%VarExeFileName%.exe
return
}
}
; 2、如果窗口未置顶则显示并激活(切换到)指定窗口
IfWinNotActive,ahk_class %VarWinClassName%
{
loop,3
{
WinShow,ahk_class %VarWinClassName%
WinMaximize,ahk_class %VarWinClassName%
WinGet, WinID, ID,ahk_class %VarWinClassName%
DllCall("SwitchToThisWindow", "UInt", WinID, "UInt", 1)
}
return
}
; 3、如果窗口已经显示并置顶则隐藏窗口
;~ WinMinimize,ahk_class %VarWinClassName%
WinHide,ahk_class %VarWinClassName%
}
IfExistRun(TargetEXE) ;检查文件是否存在并运行程序
{
IfExist,%ProgramDir%\%TargetEXE%\%TargetEXE%.exe
Run,%ProgramDir%\%TargetEXE%\%TargetEXE%.exe
else
{
ToolTip,未找到文件%ProgramDir%\%TargetEXE%\%TargetEXE%.exe
SetTimer, RemoveToolTip, 5000
}
}
RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
return
;
;===== 脚本结束 =====
///////////////////////////////////////
;~ %A_ScriptDir%\scripts\无窗口全局热字串定义.ahk
; 用AutoHotkey的热字串功能启动常用电脑程序软件 Version 2 Build 20191214
; 电脑上的快捷键太多了,记都记不住,容易冲突和搞混,所以做了个热字串启动
; 用法:运行此脚本后在键盘上输入字符串 /np
; 此脚本的写作和调试完成日期:2019年12月12日
; 此脚本的作者:徐晓亮 (aahk)
; 此脚本作者的腾讯QQ电子邮箱地址:595076941@QQ.com
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance,force ;当此脚本已经运行时自动替换旧实例再次运行。
#Persistent ;让脚本持久运行(即直到用户关闭或遇到 ExitApp)。
DetectHiddenWindows,On ;设置脚本可以“看见”隐藏的窗口。
SetTitleMatchMode,2 ;窗口标题匹配模式改成某个位置必须包含WinTitle。
;~ global exename
;~ exename=Notepad2
:*:/np::
Hotstrings("Notepad2")
return
:*:/qq::
Hotstrings2("qq")
return
:*:/tc::
Hotstrings("TotalCMD")
return
:*:/wk::
打开随身U盘_办公专用盘()
ToolTip,正在启动EverEdit_请稍后...
SetTimer, RemoveToolTip, 3000
return
:*:/ee::
IfExist,C:\Users\Administrator\AppData\Local\EverEdit\EverEdit.exe
{
Run,C:\Users\Administrator\AppData\Local\EverEdit\EverEdit.exe
}
else
{
MsgBox,没有找到可执行文件C:\Users\Administrator\AppData\Local\EverEdit\EverEdit.exe
}
ToolTip,正在启动EverEdit_请稍后...
SetTimer, RemoveToolTip, 3000
return
Hotstrings(ExeName)
{
IfExist,D:\Program\%ExeName%\%ExeName%.exe
{
Run,D:\Program\%ExeName%\%ExeName%.exe
}
else
{
MsgBox,没有找到可执行文件D:\Program\%ExeName%\%ExeName%.exe
}
ToolTip,正在启动%ExeName%_请稍后...
SetTimer, RemoveToolTip, 3000
}
Hotstrings2(ExeName2)
{
IfExist,D:\Program\%ExeName2%\Bin\%ExeName2%.exe
{
Run,D:\Program\%ExeName2%\Bin\%ExeName2%.exe
}
else
{
MsgBox,没有找到可执行文件D:\Program\%ExeName2%\Bin\%ExeName2%.exe
}
ToolTip,正在启动%ExeName2%_请稍后...
SetTimer, RemoveToolTip, 3000
}
:*:/sg::
IfExist,D:\Program\SogouExplorer\SogouExplorer.exe
Run,D:\Program\SogouExplorer\SogouExplorer.exe
ToolTip,正在启动搜狗高速浏览器_请稍后...
SetTimer, RemoveToolTip, 3000
return
; ===== 函数定义段 =====
打开随身U盘_办公专用盘()
{ 随身U盘的盘符:=搜索随身U盘并设置盘符()
if (随身U盘的盘符<>0)
{ ToolTip
FileCreateDir, %随身U盘的盘符%:\01-办公文件
DetectHiddenWindows,On
SetTitleMatchMode,2
;~ 需要手动或用脚本语句设置一下系统,工具->文件夹选项->查看->在标题栏显示完整路径
IfWinExist,01-办公文件
{
WinShow,01-办公文件
WinActivate,01-办公文件
}
else
{
Run,%随身U盘的盘符%:\01-办公文件
}
loop,5
{
WinMove,01-办公文件 ahk_class CabinetWClass,,A_ScreenWidth/2,0,A_ScreenWidth/2,A_ScreenHeight-35
Sleep,100
} }
else
ToolTip,没有找到随身U盘
SetTimer, RemoveToolTip, 5000
}
;
; 根据磁盘卷标搜索到盘符后,可以再使用 IfExist 命令检查文件或文件夹是否存在。先检测,后执行。
搜索随身U盘并设置盘符()
{ 找到U盘:=false
DriveGet,盘符清单,List
loop,Parse,盘符清单
{ DriveGet,卷标,Label,%A_LoopField%:
IfInString,卷标, 随身固态U盘
{ 找到U盘:=true
return,%A_LoopField%
} }
if (not 找到U盘)
{ return,0
} }
;
;
RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
return
;
;
;===== 脚本结束 =====
///////////////////////////////////////