595076941@qq.com

001-电脑操作规范-2019年03月.doc

001-电脑操作规范-2019年03月.doc

 

本文作者:徐晓亮 BoAi

作者腾讯QQ号码:595076941

 

//////////////////////////////////////////////////////

001、在电脑桌面上新建批处理文件

文件名改成“dn电脑操作规范-2019年03月.bat”

并添加如下一行脚本语句:

start /max D:\Prog\SogouExplorer\SogouExplorer.exe https://www.cnblogs.com/delphixx/p/10652763.html

 

//////////////////////////////////////////////////////

002、安装并设置打开“百度网盘PC版”桌面快捷方式的

右键菜单的属性自定义快捷键为  F8

所有办公类文档表格图片文件都在百度网盘中

新建改名编辑移动和删除

 

//////////////////////////////////////////////////////

003、新建当前工作的桌面上的非办公本地文件夹的桌面快捷方式

并设置快捷键为 F4

 

//////////////////////////////////////////////////////

004、安装EmEditor软件用于编辑TXT纯文本文件

立即保存 <Ctrl> + S 

EmEditor 定时备份和自动保存设置 <Alt> + <Enter>

工具 -> 当前配置 -> 自动保存

工具-> 所有配置

 

005、安装WPS Office 2016 专业版用于编辑doc文档和xls表格

WPS定时备份设置 <Alt> + F L

文件 -> 选项 -> 备份设置 

切换标签 <Ctrl> + <Tab>

关闭当前文件标签 <Ctrl> + W

关闭所有文件 <Alt> + <F4>

///////////////////////////////////////////////////////////

006、安装Photoshop CS6 用于编辑jpg图片

 

///////////////////////////////////////////////////////////

007、对需要一般保密的文件用极品私人密盘加密

 

//////////////////////////////////////////////////////

008、文件关闭后自动备份

采用AutoHotkey脚本定时自动压缩备份和百度网盘上传备份相结合的方式进行文件备份

 

;【标题:BackupTimer等待文件关闭后自动压缩备份文件.ahk】,【腾讯QQ号 595076941 】
;【作者:BoAi】,【写作日期:2019年3月25日】,【版本号:第0版】,【手机号138#####488】
;
; 用法:
; 1 安装WinRAR压缩软件和AutoHotkey自动化热键脚本编辑、测试和运行软件。
; 2 在此脚本所在的文件夹新建一个与此脚本同名的Excel工作簿文件(*.xls)。
; 3 运行此脚本并在电脑上检验备份效果。
; 4 经常编辑的文件,建议发送此脚本文件的快捷方式到电脑桌面。
; 5 为防止丢失源代码,建议把此AutoHotkey脚本源代码复制粘贴到以下两个文件中
; C:\Program Files\Kingsoft\WPS Office\10.8.2.6666\office6\mui\default\templates\newfile.wps
; C:\Program Files\Kingsoft\WPS Office\10.8.2.6666\office6\mui\default\templates\newfile.et
; 并修改这两个文件的作者属性值 (快捷键<ALT> FII)。
#SingleInstance,force
#Persistent
#NoEnv
;; #Warn
SendMode Input
SetWorkingDir %A_ScriptDir%
global FName
StringLeft,FName,A_ScriptName,StrLen(A_ScriptName)-4
BackupWorkbook("D")
RunWait,%A_ScriptDir%\%FName%.xls
BackupWorkbook("D")
BackupWorkbook("E")
BackupWorkbook("F")
BackupWorkbook("G")
BackupWorkbook("H")
BackupWorkbook("I")
BackupWorkbook("J")
BackupWorkbook("K")
BackupWorkbook("L")
BackupWorkbook("M")
BackupWorkbook("N")
ExitApp
return
BackupWorkbook(DiskVolume)
{
FileCreateDir,%DiskVolume%:\备份文件\%FName%的备份
; 说明:为了兼容含有空格的文件夹路径,此处的Run命令的文件路径参数请加上双引号
;~ Run,"C:\PROGRA~1\WINRAR\WINRAR.EXE" A -AG -hp333--- -INUL "%DiskVolume%:\备份文件\%FName%的备份\%FName%的备份.rar" "%A_ScriptDir%\%FName%.xls"
Run,"C:\PROGRA~1\WINRAR\WINRAR.EXE" A -AG -INUL "%DiskVolume%:\备份文件\%FName%的备份\%FName%的备份.rar" "%A_ScriptDir%\%FName%.xls"
FileCopy,%A_ScriptFullPath%,%DiskVolume%:\备份文件\%FName%的备份\%A_ScriptName%,1
}
; DriveGet,盘符清单,List
; loop,Parse,盘符清单
; --- 脚本到此行结束 --- 第1页 【共1页】

 

//////////////////////////////////////////////////////

009、安装Rolan 1.3.6.1 用于快速搜索并打开程序

把 Rolan 的窗口呼出热键设置为 <Alt> + R

 

010、安装MasterSeeker用于搜索本地文件 

 

 

 

011、安装FileLocator Pro 用于搜索本地文件正文内容

 

//////////////////////////////////////////////////////

012、 [每人必看][电脑重要设置][办公自动化]
  WPS Office 2019 专业版的文档表格作者属性的设置
  20190310(草稿版)
 
 
 
此文作者的腾讯QQ号码是  
 
595076941
 
 
 
说明:
通过给文档表格添加作者属性可以在今后的文档表格管理中带来极大的方便,添加作者属性然后按照作者排序可以快速区分文件的作者,便于文档表格图片的清理、分类和整理。
 

 

 
操作系统版本Windows 7 旗舰版 版本6.1 (内部版本7601)
WPS版本 WPS Office 2019 专业版 (已付费零售版)
WPS文字的版本号11.8.2.8053
在编辑时的文件在文件夹详细信息查看视图中看不到作者属性
只有微软的文档表格文件(请用WPS编辑)才具有作者属性
晓亮(既本人)的文档表格的作者属性统一设置为 BoAi
 
文件的作者属性取值举例:
BoAi-西南办公室电脑
BoAi-苏州家中电脑
BoAi-上海办公室电脑
BoAi-挪威办公室电脑
BoAi-澳大利亚办公室电脑
BoAi-美国办公室电脑
 
 
01、修改正在编辑中的文档表格的作者
方法一:按快捷键 <Alt> Fii <Alt>+A
方法二:菜单操作 单击左上角WPS字样 -> 文件信息 ->属性
 
02、永久设置通过新建菜单创建的文档表格的作者属性
方法一:按快捷键 <Alt> FL <End> <Up 6> (按6次向上方向键) <Alt>N
方法二:菜单操作 单击左上角WPS字样 -> 选项 ->用户信息
(在WPS文字中修改作者后会同步自动附带修改WPS表格中的作者)
 
03、永久设置通过鼠标右键菜单新建文件的作者属性
方法一:修改新建文件的模板文件newfile.从而实现新建文件时自动添加作者和相关模板样式格式。
修改文件1:
C:\Program Files\Kingsoft\WPS Office\11.8.2.8053\office6\mui\zh_CN\templates\newfile.wps
修改文件2:
C:\Program Files\Kingsoft\WPS Office\11.8.2.8053\office6\mui\zh_CN\templates\newfile.et
修改好以上两个文件的作者属性、正文字体等格式后请压缩备份一下修改过的文件,保存工作成果,便于今后设置使用。
 
04、批量修改已有文件的作者属性
我这里不写脚本了偷一下懒直接用现成的软件了,有兴趣的朋友(同学)也可以用AutoHotkey写一个批量智能递归遍历修改文件作者属性的脚本。
 
先按快捷键 <Ctrl>+F 找出所有需要修改属性的文档 , 例如查找  *乔治的文档.doc
然后全部选中所有这些文档并按快捷键<Alt>+<Enter>
最后在“详细信息”中修改作者的属性值
(由于文档表格的属性值是存储在doc或者xls文件体中的
所以不修改的话可以可靠的永久保存)
 

 
05、最后清理一下鼠标右键的新建菜单,还是用软件,MenuMgr右键管家
 

 

 
由于我只用Word 97 - 2003和Excel 97 - 2003文档表格格式的文件,从不使用现在的现代全新docx和xlsx文档表格格式的文件所以不讨论有关新格式的作者属性修改方法,(新格式作者修改的是带宏的模板文件修改比较麻烦需要先编辑好文档另存为带宏的模板格式的文件然后再重命名覆盖文件,其他格式文件的默认新建修改也与WPS文字的修改相似)
 
06、一键设置文档表格作者和清理鼠标右键菜单的AutoHotkey脚本源代码(开发中。。。)
 
07、批量设置文档表格作者的AutoHotkey脚本源代码(支持无限级别子文件夹中的文档表格)(FileCopy、RegDelete开发中。。。)(敬请期待)
 
 
;;  loop,Files,%A_ScriptDir%\*.*,R ;递归遍历穷举文件夹和子文件夹中的文件
 
 
08、最后WinRAR手动压缩带日期掩码备份所有修改过的文件供今后使用
文件1:
C:\Program Files\Kingsoft\WPS Office\11.8.2.8053\office6\mui\zh_CN\templates\newfile.wps
C:\Program Files\Kingsoft\WPS Office\11.8.2.8053\office6\mui\zh_CN\templates\newfile.et
C:\Program Files\Kingsoft\WPS Office\11.8.2.8053\oem\companylogo.PNG

//////////////////////////////////////////////////////

012、教你做一个网络协同办公的工作表
http://baijiahao.baidu.com/s?id=1601712552166391878&wfr=spider&for=pc
教你做一个网络协同办公的工作表
在学校里,考评学生阶段性学业情况,常用的措施就是考试,无论是周练、月考或是期中、期末的大考,除了阅卷的工作比较辛苦,还有一项工作也很烦琐,就是登分、以及各类数据分析,今天,我们先就优化登分的效率,为大家提供一个思路以及应用操作。
思路是,登分工作由专人录入改为所有阅卷老师协同录入,由多表录入改为一表录入。实现这一思路,需要一张网,也就是互联网、校内局域网,办公室的老师能同时访问(基本上学校都有这个条件),还要有一份能让大家协同登分的工作表,这份表要能实现以下功能:1)可同时登分,分别保存,数据互不影响;2)表头及关键文字内容不可更改;3)表头部分要固定显示;4)为防止误输入,只允许一定范围的整数录入。如图:
图一
下面,我们就如何做这一个登分表,分步说明:
1、如图一,我们先在EXCEL表中输入基本的表头、标题、以及考生的相关信息。简单美化一下表格,整个表设置文字居中,字体适中,用虚线做表格线,标题设成灰底色,并用白线分隔。
2、将鼠标停在E3单元格,点“视图”、“冻结窗格”、“冻结拆分窗格”,目的就是冻结2行标题行和左边4列内容
图二
3、设置非输入数值单元格的保护,目的就是,只能在对应学科下输入数字,而不能更改其他单元格内容,防止误删除。先选中整个表格,然后设置单元格格式,在“保护”栏中全部勾选。
图三
再选中要录入成绩的单元格区域,设置单元格格式,在“保护”栏中,全部不勾选。
图四
4、设置成绩录入区域的有效性,限制只录入0-160分的整数值。选中成绩录入区域,点“数据”、“数据有效性”,选“整数”、介于0-160,然后,确定。
图五
5、保护工作表,共享工作表。只有设置了工作表的保护,才能防止对非成绩录入区域的误操作!只有共享了工作表,才能让所有人都能在一张表上录入成绩,并可以分别保存。并且,这两个先后顺序不能反过来。
图六
图七
这份协作登分的工作表,完成以后,把它放在学校办公用的局域网上,让大家能同时访问到即可。同样,这样的协作工作表可以应用于其他单位、机关等相关部门,只要有协作要求的报表,都可以参照这个思路来设计,希望你有收获。

 

 

 

013、重要确定经验分享到博客园 

http://www.cnblogs.com/delphixx

 

博客园网址用户名密码

登录网址

https://passport.cnblogs.com/user/signin

登录用户名

boai

登录密码

g???-?3###

 

 

014、为了避免用“杏雨梨云启动U盘”安装Windows7专业版操作系统,请用一键GHOST硬盘版备份操作系统C盘磁盘分区。

 

 

 

 

 

////////////////////////////////////////////////// 

015、安装AutoHotkey并设置自动启动AutoRun脚本

 


rem 一键安装AutoHotkey自动化热键脚本语言编程环境

 

D:
cd \Program\AutoHotkey

 

rem 设置ahk文件类型关联到AutoHotkeyU32.exe
rem 以便运行脚本
rem 解压缩“AutoHotkey_1.1.30.01_setup.exe”安装文件得到setup.exe

 

rem 由于AutoHotkey的安装包会记住上次安装的位置,
rem 为了软件安装位置固定到 D:\Program\AutoHotkey 文件夹所以此处必需指定安装目标文件夹
D:\Program\AutoHotkey\ahksetup.exe /S /D=D:\Program\AutoHotkey

 

rem 添加ahk文件类型鼠标右键菜单
rem 运行、编辑、编译脚本的关联,感谢作者写出这么好的脚本
D:\Program\AutoHotkey\autohotkeyu32.exe D:\Program\AutoHotkey\MenuSetup.ahk

 

 

 

///////////////////////////////////////////////

 

/*
AutoHotkey 版本: 1.x
操作系统: WinXP
作者: 甲壳虫<jdchenjian@gmail.com>
博客: http://hi.baidu.com/jdchenjian
脚本说明: 此工具用来修改 AutoHotkey 脚本的右键菜单关联,适用于 AutoHotkey 安装版、绿色版。
脚本版本: 2009-01-21

 

修改作者: 兔子
更新说明:
2010.01.09 之前某个时间,修改AHK路径、编辑器路径、编译器路径,默认全部在当前目录下寻找
2010.01.09 去掉默认在新建菜单的勾
2010.06.21 如果SCITE为默认编辑器,则复制个人配置文件“SciTEUser.properties”到%USERPROFILE%
2010.06.25 修正因#NoEnv使%USERPROFILE%变量直接引用无效
2016.04.18 删除“2010.06.21”的改动
*/

 

; --- 20190207 晓亮修改 ---

 

#NoEnv
#SingleInstance, force
SendMode Input
SetWorkingDir %A_ScriptDir%

 

; 版本(仅用于显示)
Script_Version=v1.0.3.2

 

; AutoHotkey 原版的相关信息写在注册表HKCR主键中,
; 尝试是当前用户否有权操作该键,如果无权操作HKCR键(受限用户),
; 可通过操作注册表HKCU键来实现仅当前用户关联AHK脚本。
IsLimitedUser:=0
RegWrite, REG_SZ, HKCR, .test
if ErrorLevel
IsLimitedUser:=1
RegDelete, HKCR, .test
if ErrorLevel
IsLimitedUser:=1

 

if IsLimitedUser=0 ; 非受限用户操作HKCR键
{
RootKey=HKCR
Subkey=
}
else ; 受限用户操作HKCU键
{
RootKey=HKCU
Subkey=Software\Classes\ ; <-- 为简化后面的脚本,此子键须以“\”结尾
}

 

; 检查是否存在AHK注册表项
RegRead, FileType, %RootKey%, %Subkey%.ahk
if FileType<>
{
RegRead, value, %RootKey%, %Subkey%%FileType%\Shell\Open\Command ;AHK路径
AHK_Path:=PathGetPath(value)
RegRead, value, %RootKey%, %Subkey%%FileType%\Shell\Edit\Command ;编辑器路径
Editor_Path:=PathGetPath(value)
RegRead, value, %RootKey%, %Subkey%%FileType%\Shell\Compile\Command ;编译器路径
Compiler_Path:=PathGetPath(value)
RegRead, Template_Name, %RootKey%, %Subkey%.ahk\ShellNew, FileName ;模板文件名
}
else
FileType=AutoHotkeyScript

 

if AHK_Path=
{
IfExist, %A_ScriptDir%\AutoHotkey.exe
AHK_path=%A_ScriptDir%\AutoHotkey.exe
}

 

if Editor_Path=
{
IfExist, %A_ScriptDir%\SciTE\SciTE.exe
Editor_Path=%A_ScriptDir%\SciTE\SciTE.exe
}

 

if Compiler_Path=
{
IfExist, %A_ScriptDir%\Compiler\Ahk2Exe.exe
Compiler_Path=%A_ScriptDir%\Compiler\Ahk2Exe.exe
}

 

if Template_Name=
Template_Name=Template.ahk

 

; --- 20190207 晓亮修改 ---
;设置AHK默认文件夹为D:\Program\AutoHotkey
AHK_path=D:\Program\AutoHotkey\AutoHotkeyU32.exe
Editor_Path=D:\Program\AutoHotkey\SciTE\SciTE.exe
Compiler_Path=D:\Program\AutoHotkey\Compiler\Ahk2Exe.exe

 

Gui, Add, Tab, x10 y10 w480 h250 Choose1, 设置|说明
Gui, Tab, 1
Gui, Add, GroupBox, x20 y40 w460 h50 , “运行脚本”关联的 AutoHotkey
Gui, Add, Edit, x35 y60 w340 h20 vAHK_Path, %AHK_path%
Gui, Add, Button, x385 y60 w40 h20 gFind_AHK, 浏览

 

Gui, Add, GroupBox, x20 y100 w460 h50 , “编辑脚本”关联的编辑器
Gui, Add, Edit, x35 y120 w340 h20 vEditor_Path, %Editor_Path%
Gui, Add, Button, x385 y120 w40 h20 gChoose_Editor, 浏览
Gui, Add, Button, x430 y120 w40 h20 gDefault_Editor, 默认

 

Gui, Add, GroupBox, x20 y160 w460 h50 , “编译脚本”关联的编译器
Gui, Add, Edit, x35 y180 w340 h20 vCompiler_Path, %Compiler_Path%
Gui, Add, Button, x385 y180 w40 h20 gChoose_Compiler, 浏览
Gui, Add, Button, x430 y180 w40 h20 gDefault_Compiler, 默认

 

Gui, Add, Checkbox, x35 y230 w270 h20 gNew_Script vNew_Script, 右键“新建”菜单中增加“AutoHotkey 脚本”
Gui, Add, Button, x310 y230 w80 h20 vEdit_Template gEdit_Template, 编辑脚本模板
Gui, Add, Button, x400 y230 w80 h20 vDelete_Template gDelete_Template, 删除脚本模板

 

Gui, Tab, 2
Gui, Font, bold
Gui, Add, Text,, AutoHotkey 脚本关联工具 ScriptSetting %Script_Version%
Gui, Font
Gui, Font, CBlue underline
Gui, Add, Text, gWebsite, 作者:甲壳虫 <jdchenjian@gmail.com>`n`n博客:http://hi.baidu.com/jdchenjian
Gui, Font
Gui, Add, Text, w450, 此工具用来修改 AutoHotkey 脚本的右键菜单关联,适用于 AutoHotkey 安装版、绿色版。
Gui, Add, Text, w450, 您可以用它来修改默认脚本编辑器、编译器,修改默认的新建脚本模板。设置后,在右键菜单中添加“运行脚本”、“编辑脚本”、“编译脚本”和“新建 AutoHotkey 脚本”等选项。
Gui, Add, Text, w450, 要取消脚本的系统关联,请按“卸载”。注意:卸载后您将无法通过双击来运行脚本,也不能通过右键菜单来启动脚本编辑器...

 

Gui, Tab
Gui, Add, Button, x100 y270 w60 h20 Default gInstall, 设置
Gui, Add, Button, x200 y270 w60 h20 gUninstall, 卸载
Gui, Add, Button, x300 y270 w60 h20 gCancel, 取消

 

Gui, Show, x250 y200 h300 w500 CEnter, ScriptSetting %Script_Version%
GuiControl, Disable, Edit_Template ; 使“编辑脚本模板”按钮无效
IfNotExist, %A_WinDir%\ShellNew\%Template_Name%
GuiControl, Disable, Delete_Template ; 使“删除脚本模板”按钮无效

 

; 当鼠标指向链接时,指针变成手形
hCurs:=DllCall("LoadCursor","UInt",NULL,"Int",32649,"UInt") ;IDC_HAND
OnMessage(0x200,"WM_MOUSEMOVE")

 

; --- 20190207 晓亮修改 ---
goto,Install
return

 

; 改变鼠标指针为手形
WM_MOUSEMOVE(wParam,lParam)
{
global hCurs
MouseGetPos,,,,ctrl
if ctrl in static2
DllCall("SetCursor","UInt",hCurs)
return
}
return

 

GuiClose:
GuiEscape:
Cancel:
ExitApp

 

; 查找 AutoHotkey 主程序
Find_AHK:
Gui +OwnDialogs
FileSelectFile, AHK_Path, 3, , 查找 AutoHotkey.exe, AutoHotkey.exe
if AHK_Path<>
GuiControl,,AHK_Path, %AHK_Path%
gosub Default_Compiler
return

 

; 选择脚本编辑器
Choose_Editor:
Gui +OwnDialogs
FileSelectFile, Editor_Path, 3, , 选择脚本编辑器, 程序(*.exe)
if Editor_Path<>
GuiControl,,Editor_Path, %Editor_Path%
return

 

; 默认脚本编辑器
Default_Editor:
IfExist, %A_ScriptDir%\SciTE\SciTE.exe
Editor_Path=%A_ScriptDir%\SciTE\SciTE.exe
else ifExist, %A_WinDir%\system32\notepad.exe
Editor_Path=%A_WinDir%\system32\notepad.exe
GuiControl,, Editor_Path, %Editor_Path%
return

 

; 选择脚本编译器
Choose_Compiler:
Gui +OwnDialogs
FileSelectFile, Compiler_Path, 3, , 选择脚本编译器, 程序(*.exe)
if Compiler_Path<>
GuiControl,,Compiler_Path, %Compiler_Path%
return

 

; 默认脚本编译器
Default_Compiler:
GuiControlGet, AHK_Path
SplitPath, AHK_Path, ,AHK_Dir
IfExist, %AHK_Dir%\Compiler\Ahk2Exe.exe
{
Compiler_Path=%AHK_Dir%\Compiler\Ahk2Exe.exe
GuiControl,, Compiler_Path, %Compiler_Path%
}
return

 

; 设置
Install:
Gui, Submit
IfNotExist, %AHK_Path%
{
MsgBox, 16, ScriptSetting %Script_Version%, AutoHotkey 路径错误 !
return
}

 

IfNotExist, %Editor_Path%
{
MsgBox, 16, ScriptSetting %Script_Version%, 编辑器路径错误 !
return
}

 

IfNotExist, %Compiler_Path%
{
MsgBox, 16, ScriptSetting %Script_Version%, 编译器路径错误 !
return
}

 

; 写入注册表
RegWrite, REG_SZ, %RootKey%, %Subkey%.ahk,, %FileType%
if New_Script=1
{
RegWrite, REG_SZ, %RootKey%, %Subkey%.ahk\ShellNew, FileName, %Template_Name%
IfNotExist, %A_WinDir%\ShellNew\%Template_Name%
gosub Create_Template
}
else
{
; --- 20190207 晓亮修改 ---
; --- 此处不要删除右键新建ahk文件的菜单所以注释掉此代码
;RegDelete, %RootKey%, %Subkey%.ahk\ShellNew
IfExist, %A_WinDir%\ShellNew\%Template_Name%
gosub Delete_Template
}

 

RegWrite, REG_SZ, %RootKey%, %Subkey%%FileType%,, AutoHotkey 脚本
RegWrite, REG_SZ, %RootKey%, %Subkey%%FileType%\DefaultIcon,, %AHK_Path%`,1
RegWrite, REG_SZ, %RootKey%, %Subkey%%FileType%\Shell,, Open
RegWrite, REG_SZ, %RootKey%, %Subkey%%FileType%\Shell\Open,, 运行脚本
RegWrite, REG_SZ, %RootKey%, %Subkey%%FileType%\Shell\Open\Command,, "%AHK_Path%" "`%1" `%*
RegWrite, REG_SZ, %RootKey%, %Subkey%%FileType%\Shell\Edit,, 编辑脚本
RegWrite, REG_SZ, %RootKey%, %Subkey%%FileType%\Shell\Edit\Command,, "%Editor_Path%" "`%1"
RegWrite, REG_SZ, %RootKey%, %Subkey%%FileType%\Shell\Compile,, 编译脚本
IfInString, Compiler_Path, Ahk2Exe.exe
RegWrite, REG_SZ, %RootKey%, %Subkey%%FileType%\Shell\Compile\Command,, "%Compiler_Path%" /in "`%1"
else
RegWrite, REG_SZ, %RootKey%, %Subkey%%FileType%\Shell\Compile\Command,, "%Compiler_Path%" "`%1"

 

/* 新版的scite不需要将“SciTEUser.properties”放在“USERPROFILE”目录下了
if Editor_Path=%A_ScriptDir%\SciTE\SciTE.exe
{
EnvGet,USERPROFILE,USERPROFILE
FileCopy,%A_ScriptDir%\SciTE\SciTEUser.properties,%USERPROFILE%\SciTEUser.properties,1
}
*/

 

;MsgBox, 64, ScriptSetting %Script_Version%, 设置完毕 !
ExitApp

 

; 卸载
Uninstall:
; --- 20190207 晓亮修改 ---
;MsgBox, 36, ScriptSetting %Script_Version%
;, 注意:卸载后您将无法通过双击来运行脚本,也不能通过右键菜单来启动脚本编辑器...`n`n确定要取消 AHK 脚本的系统关联吗 ?
;IfMsgBox, Yes
;{
;RegDelete, %RootKey%, %Subkey%.ahk
;RegDelete, %RootKey%, %Subkey%%FileType%
;gosub Delete_Template
;ExitApp
;}
return

 

; 编辑脚本模板
Edit_Template:
GuiControlGet, Editor_Path
IfNotExist, %Editor_Path%
{
MsgBox, 64, ScriptSetting %Script_Version%, 脚本编辑器路径错误 !
return
}
IfNotExist, %A_WinDir%\ShellNew\%Template_Name%
gosub Create_Template
Run, %Editor_Path% %A_WinDir%\ShellNew\%Template_Name%
return

 

; 使编辑脚本模板按钮有效/无效
New_Script:
GuiControlGet, New_Script
if New_Script=0
GuiControl, Disable, Edit_Template
else
GuiControl, Enable, Edit_Template
return

 

; 新建脚本模板
Create_Template:
GuiControlGet, AHK_Path
FileGetVersion, AHK_Ver, %AHK_Path%

 

FileAppend,
(
/*
AutoHotkey 版本: %AHK_Ver%
操作系统: %A_OSVersion%
作者: %A_UserName%
网站: http://www.AutoHotkey.com
脚本说明:
脚本版本: v1.0
*/

 

#NoEnv
SendMode Input
SetWorkingDir `%A_ScriptDir`%

 

), %A_WinDir%\ShellNew\%Template_Name%

 

GuiControl, Enable, Delete_Template ; 使“删除脚本模板”按钮有效
return

 

; 删除脚本模板
Delete_Template:

 

; --- 20190207 晓亮修改 ---
;MsgBox, 36, ScriptSetting %Script_Version%
; , 要删除当前的 AHK 脚本模板吗 ?`n`n脚本模板被删除后,仍可通过本工具重建模板。
;IfMsgBox, Yes
;FileDelete, %A_WinDir%\ShellNew\%Template_Name%
;GuiControl, Disable, Delete_Template ; 使“删除脚本模板”按钮无效
return

 

; 打开网站
Website:
Run, http://hi.baidu.com/jdchenjian
return

 

; 从注册表值字符串中提取路径
PathGetPath(pSourceCmd)
{
local Path, ArgsStartPos = 0
if (SubStr(pSourceCmd, 1, 1) = """")
Path := SubStr(pSourceCmd, 2, InStr(pSourceCmd, """", False, 2) - 2)
else
{
ArgsStartPos := InStr(pSourceCmd, " ")
if ArgsStartPos
Path := SubStr(pSourceCmd, 1, ArgsStartPos - 1)
else
Path = %pSourceCmd%
}
return Path
}

//////////////////////////////////////////////////////////////////

 

;
; # 此脚本修改时间 见WinRAR压缩包日期时间掩码文件名
;
;--- 计时器 SetTimer 创建启动区,SetTimer可以模拟多线程从而不影响主线程的流畅执行
SetTimer,01防止重复运行此脚本,-1000 ;请在SciTE4AutoHotkey中选中单词并按快捷键F12跳转到函数定义处
SetTimer,02设置全局无窗口快捷键,-1000 ;请在SciTE4AutoHotkey中选中单词并按快捷键F12跳转到函数定义处
SetTimer,03保持MasterSeeker窗口常驻内存,9000 ;请养成按<Win> + F 隐藏MasterSeeker窗口的习惯
SetTimer,04设置此脚本参数,-1000
SetTimer,05设置此脚本用户自定义变量,-1000
;;~ SetTimer,06运行国税金税盘开票软件,-100
IfExist,D:\Progra~1\开票软件\MainExecute.exe
{
Run,D:\Progra~1\开票软件\MainExecute.exe
loop,333
{
WinGet, WinID, ID,LoginForm
DllCall("SwitchToThisWindow", "UInt", WinID, "UInt", 1)
WinGetActiveTitle,WinActiveTitlekp
Sleep,500
IfInString,WinActiveTitlekp,LoginForm
{
ControlClick,登录,LoginForm
}
Sleep,500
IfWinActive,,上报汇总已成功
{
ControlClick,确认,,上报汇总已成功
}
;~ 如果成功登录国税开票软件,那么立即退出本次LOOP循环
IfInString,WinActiveTitlekp,增值税发票税控开票软件
{
break
}
;~ 证书口令不能为空,退出循环,手工登录
IfWinExist,,证书口令不能为空
{
break
}
}
Sleep,100
;~ Run,%comspec% /c C:\Windows\System32\Rundll32.Exe user32.dll LockWorkStation
Sleep,2000
WinClose,USB KEY PIN,请输入KEY的PIN码
}
else
;~ Run,%comspec% /c C:\Windows\System32\Rundll32.Exe user32.dll LockWorkStation
SetTimer,07运行一些软件应用程序,-1000
SetTimer,08关广告窗口删除广告文件,3000
;;SetTimer,09定时关闭电脑,3000

; 输入热字串WT,插入当前时间 ( what is the time? )
::wt::
NowTimeString=%A_YYYY%年%A_MM%月%A_DD%日%A_Hour%时%A_Min%分
Clipboard=%NowTimeString%
Send ^v
return
return
;
;--- 此脚本文件相关信息说明区
;
; ###################################################################
; #
; # 脚本名称: 跟随Win7系统启动的AHK脚本
; # 文件名 跟随Win7系统启动的AHK脚本.ahk
; # 作用 设置全局无窗口快捷键,批量自动键盘鼠标文件操作,定时批量操作
; # 用法 把此AHK脚本文件复制到 “shell:startup”文件夹中
; # shell:startup”文件夹一般位于开始菜单->所有程序->启动 文件夹
; # 类型 AutoHotkey 脚本程序
; # 文件保存位置 D:\Program\AHK\AHKScript
; # 创建时间 2019年01月19日19时19分
; # 修改时间
; # 原创作者 徐晓亮 aahk
; # 原创作者的腾讯电子邮箱地址 595076941@QQ.com
; # 原创作者的手机号码
; #
; ###################################################################
;

01防止重复运行此脚本()
{
#SingleInstance,force
loop,33
{
DetectHiddenWindows,On
Sleep,33
IfWinExist,QQ595076941_HotkeySet
ExitApp
}
Gui, Show, Hide,QQ595076941_HotkeySet
}


02设置全局无窗口快捷键()
{
Hotkey,F10,终止此脚本执行 ;按F10键此脚本立即停止执行并退出
Hotkey,``,08_激活或隐藏窗口唯一办公包内盘927GB的办公专用文件夹
Hotkey,`#b,09_加密压缩备份唯一办公包内盘927GB的办公专用文件夹到D盘
Hotkey,`#n,10_激活或隐藏窗口EmEditor
Hotkey,`#e,11_激活或隐藏窗口TotalCommander ; 按热键 Win+E 激活 TotalCommander
Hotkey,`#f,12_激活或隐藏窗口MasterSeeker
Hotkey,`#g,13_激活或隐藏窗口Everything
Hotkey,`#s,14_激活或隐藏窗口SogouExplorer
Hotkey,`#c,15_激活或隐藏窗口计算器Calc ; 按热键 Win + C,打开计算器
Hotkey,`^!E,16_用SciTE4AutoHotkey编辑此脚本
Hotkey,`^!H,17_激活或隐藏窗口AutoHotkey中文CHM帮助文件
Hotkey,`^!R,18_重启_重新装载运行_此脚本
}

03保持MasterSeeker窗口常驻内存()
{
Process,Exist,MasterSeeker.exe
if (%ErrorLevel%=0)
{
IfWinNotExist,MasterSeeker 1.5.1 by DxCK
{
IfWinNotExist,ahk_exe MasterSeeker.exe
{
IfExist,D:\Program\MasterSeeker\MasterSeeker.exe
Run,D:\Program\MasterSeeker\MasterSeeker.exe
;~ WinWait,MasterSeeker 1.5.1 by DxCK
;~ WinMinimize,MasterSeeker 1.5.1 by DxCK ahk_class WindowsForms10.Window.8.app.0.218f99c, statusStri
WinWait,ahk_class WindowsForms10.Window.8.app.0.218f99c
loop,9
{
WinHide,ahk_class WindowsForms10.Window.8.app.0.218f99c
Sleep,100
}
}
}
}
}

04设置此脚本参数()
{
#NoEnv
#Persistent ;让脚本持久运行(即直到用户关闭或遇到 ExitApp)。
#WinActivateForce
;~ #NoTrayIcon
SetWorkingDir,%A_ScriptDir%
DetectHiddenWindows,On
SetTitleMatchMode,2
;~ SetBatchLines,
;~ SetKeyDelay,
;~ SetWinDelay,
;~ SetControlDelay,
CoordMode,Mouse,Screen
CoordMode,Pixel,Screen
CoordMode,ToolTip,Screen
ListLines,Off
SendMode,Input
SetBatchLines,-1
SetStoreCapsLockMode, On
}

05设置此脚本用户自定义变量()
{
global 移动硬盘盘符 ;带冒号:
global Program
Program=D:\Program
}
/*

05运行国税金税盘开票软件()
{
IfExist,D:\Progra~1\开票软件\MainExecute.exe
{
Run,D:\Progra~1\开票软件\MainExecute.exe
WinWait,LoginForm
MsgBox,%A_Index% ccc
ControlClick,登录,LoginForm
WinClose,,上报汇总已成功

;~ loop,333
;~ {
;~ WinWait,LoginForm, 增值税发票税控开票软,1
;~ WinWait,LoginForm ahk_class WindowsForms10.Window.8.app.0.20f9772_r11_ad1, 增值税发票税控开票软,1
;~ WinActivate,LoginForm ahk_class WindowsForms10.Window.8.app.0.20f9772_r11_ad1, 增值税发票税控开票软,1
;~ WinWaitActive,LoginForm ahk_class WindowsForms10.Window.8.app.0.20f9772_r11_ad1, 增值税发票税控开票软,1
;~ WinGet, WinID_kp, ID,LoginForm, 增值税发票税控开票软
;~ DllCall("SwitchToThisWindow", "UInt", WinID_kp, "UInt", 1)
;~ Sleep,100

;~ 如果成功登录国税开票软件,那么立即退出本次LOOP循环
IfWinExist,增值税发票税控开票软件,系统设置
{
ToolTip,A_Index aaa
;~ break

}
;~ IfWinExist,增值税发票税控开票软件,发票管理
;~ break
;~ IfWinExist,增值税发票税控开票软件,报税处理
;~ break
;~ IfWinExist,增值税发票税控开票软件,系统维护
;~ break
;;证书口令不能为空,退出循环,手工登录
;~ IfWinExist,,证书口令不能为空
;~ break
;~ }
Sleep,100
Run,%comspec% /c C:\Windows\System32\Rundll32.Exe user32.dll LockWorkStation
Sleep,2000
WinClose,USB KEY PIN,请输入KEY的PIN码
}
else
{
;~ 自动登录然后再锁定桌面,再次登录时会显著减少时间占用
Run,%comspec% /c C:\Windows\System32\Rundll32.Exe user32.dll LockWorkStation
}
}

*/

07运行一些软件应用程序()
{
IfExist,"D:\Program\PCOff\PCOff.exe"
Run,"D:\Program\PCOff\PCOff.exe"
;~ IfExistRun("D:\Program\RunZ\RunZ.exe") ;快速搜索本地软件程序并启动程序工具,所有程序都安装在文件夹D:\Program中
;~ SetTimer,MinimizeRunZ,-100
IfExistRun("D:\Program\WiseDesktop\WiseDesktop.exe") ;虚拟桌面
IfExistRun("D:\Program\PCOff\PCOff.exe") ;定时强制关机精灵1.0 在 17:05 下班后定时强制关闭电脑
;~ IfExistRun("D:\Program\ALMRun\ALMRun.exe")
;~ SetTimer,MinimizeALMRun,-100
;~ IfExistRun("当前工作文件夹.ahk")
;~ loop,333
;~ {
;~ ControlSend,Edit1,{Esc}, ALMRun 快速启动工具 ahk_class wxWindowNR, panel
;~ }
}

IfExistRun(TargetEXE) ;检查文件是否存在并运行程序
{
IfExist,%TargetEXE%
Run,%TargetEXE%
else
{
ToolTip,未找到文件%TargetEXE%
SetTimer, RemoveToolTip, 5000
}
}

RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
return
;~ MinimizeRunZ()
;~ {
;~ WinWait,RunZ
;~ loop,3
;~ {
;~ WinHide,RunZ
;~ }
;~ }

MinimizeALMRun()
{
WinWait,ALMRun
loop,3
{
WinHide,ALMRun
}
}


终止此脚本执行:
ToolTipEnClose(A_ScriptName "(即此脚本)已经退出" )
Sleep,900
ExitApp
return

ToolTipEnClose(ToolTipText) ;显示会定时关闭的提示窗口
{
ToolTip,%ToolTipText%,% A_ScreenWidth/2-150,% A_ScreenHeight/2-150
; 此处使用SetTimer而不使用Sleep
SetTimer, 关闭提示窗口, 3000
}

关闭提示窗口:
SetTimer, 关闭提示窗口,Off
ToolTip
return

; ######################################

 


08_激活或隐藏窗口唯一办公包内盘927GB的办公专用文件夹:
唯一办公包内盘927GB的盘符:=搜索唯一办公包内盘927GB并设置盘符()
if (唯一办公包内盘927GB的盘符<>0)
{
; 1、如果程序没有运行则运行程序
Process,Exist,TotalCMD.exe
if (%ErrorLevel%=0)
{
IfWinNotExist,9.21a,%唯一办公包内盘927GB的盘符%:\
{
IfExist,D:\Program\TotalCMD\TotalCMD.exe
Run,D:\Program\TotalCMD\TotalCMD.exe %唯一办公包内盘927GB的盘符%:\
else
MsgBox,找不到文件 D:\Program\TotalCMD\TotalCMD.exe
}
}

; 2、如果窗口置顶并且已经隐藏则显示并激活(切换到)指定窗口

WinGet,WinStyle ,Style,9.21a
if (not(WinStyle&0x10000000))
{
loop,22
{
WinShow,9.21a
WinMaximize,9.21a
WinGet, WinID, ID,9.21a
DllCall("SwitchToThisWindow", "UInt", WinID, "UInt", 1)
WinActivate,9.21a
#WinActivateForce
WinActivate,9.21a
WinGetActiveTitle,WinActiveTitle
; 窗口处于置顶状态, 执行适当的动作.
IfInString,WinActiveTitle,9.21a
{
IfWinNotExist,9.21a,%唯一办公包内盘927GB的盘符%:\
{
IfExist,D:\Program\TotalCMD\TotalCMD.exe
{
Process,Close,TotalCMD.exe
Run,D:\Program\TotalCMD\TotalCMD.exe %唯一办公包内盘927GB的盘符%:\
}
else
MsgBox,找不到文件 D:\Program\TotalCMD\TotalCMD.exe
}
return
}
}
}

; 3、如果窗口未置顶则显示并激活(切换到)指定窗口
IfWinNotActive,ahk_exe TotalCMD.exe
{
loop,22
{
WinShow,9.21a
WinMaximize,9.21a
WinGet, WinID, ID,9.21a
DllCall("SwitchToThisWindow", "UInt", WinID, "UInt", 1)
WinGetActiveTitle,WinActiveTitle
; 窗口处于置顶状态, 执行适当的动作.
IfInString,WinActiveTitle,9.21a
{
IfWinNotExist,9.21a,%唯一办公包内盘927GB的盘符%:\
{
IfExist,D:\Program\TotalCMD\TotalCMD.exe
{
Process,Close,TotalCMD.exe
Run,D:\Program\TotalCMD\TotalCMD.exe %唯一办公包内盘927GB的盘符%:\
}
else
MsgBox,找不到文件 D:\Program\TotalCMD\TotalCMD.exe
}
return
}
}
}

; 4、如果窗口已经显示并置顶则隐藏窗口
WinMinimize,9.21a
WinHide,9.21a
}
else
{
ToolTip,请连接唯一办公包内盘927GB,% A_ScreenWidth/2-150,% A_ScreenHeight/2-150
SetTimer, 关闭提示窗口,3000
Sleep,3000
}
;~ SetTimer,激活并最大化办公专用文件夹窗口
;~ WinMaximize,ahk_class CabinetWClass
;~ WinMaximize,ahk_exe explorer.exe
return

09_加密压缩备份唯一办公包内盘927GB的办公专用文件夹到D盘:
唯一办公包内盘927GB的盘符:=搜索唯一办公包内盘927GB并设置盘符()
if (唯一办公包内盘927GB的盘符<>0)
{
FileCreateDir,D:\01-单位办公文档
IfExist,c:\Progra~1\WinRAR\WinRAR.exe
{
Pa := % decryptstr("QUXy6xNsR+GLUgwFOPlwPAAA","my_secret_key")
Run,c:\Progra~1\WinRAR\WinRAR.exe u -hp%Pa% -IBCK -INUL -m5 -or -r -tk D:\01-单位办公文档\办公文档备份%A_YYYY%%A_MM%%A_DD%.rar %唯一办公包内盘927GB的盘符%:\01-单位办公文档\*.*
ToolTipEnClose("正在加密压缩备份办公文档表格图片。。。")
}
else
{
ToolTip,找不到文件 c:\Progra~1\WinRAR\WinRAR.exe,% A_ScreenWidth/2-150,% A_ScreenHeight/2-150
SetTimer, 关闭提示窗口,9000
Sleep,9000
}
}
else
{
ToolTip,请连接唯一办公包内盘927GB,% A_ScreenWidth/2-150,% A_ScreenHeight/2-150
SetTimer, 关闭提示窗口,3000
Sleep,3000
}
; 这里用SetTimer是防止主线程阻塞引起下一个快捷键输入的接收和处理
SetTimer,关闭WinRAR出错提示窗口,500
return


encryptStr(str="",pass="")
{
if !(enclen:=(StrPut(str,"utf-16")*2))
return "Error: Nothing to Encrypt"
if !(passlen:=StrPut(pass,"utf-8")-1)
return "Error: No Pass"
enclen:=Mod(enclen,4) ? (enclen) : (enclen-2)
VarSetCapacity(encbin,enclen,0)
StrPut(str,&encbin,enclen/2,"utf-16")
VarSetCapacity(passbin,passlen+=Mod((4-Mod(passlen,4)),4),0)
StrPut(pass,&passbin,StrLen(pass),"utf-8")
_encryptbin(&encbin,enclen,&passbin,passlen)
return _crypttobase64(&encbin,enclen)
}

decryptStr(str="",pass="")
{
if !((StrPut(str,"utf-16")*2))
return "Error: Nothing to Decrypt"
if !((passlen:=StrPut(pass,"utf-8")-1))
return "Error: No Pass"
VarSetCapacity(passbin,passlen+=Mod((4-Mod(passlen,4)),4),0)
StrPut(pass,&passbin,StrLen(pass),"utf-8")
enclen:=_cryptfrombase64(str,encbin)
_decryptbin(&encbin,enclen,&passbin,passlen)
return StrGet(&encbin,"utf-16")
}

_MCode(mcode)
{
static e := {1:4, 2:1}, c := (A_PtrSize=8) ? "x64" : "x86"
if (!RegExMatch(mcode, "^([0-9]+),(" c ":|.*?," c ":)([^,]+)", m))
return
if (!DllCall("crypt32\CryptStringToBinary", "str", m3, "uint", 0, "uint", e[m1], "ptr", 0, "uint*", s, "ptr", 0, "ptr", 0))
return
p := DllCall("GlobalAlloc", "uint", 0, "ptr", s, "ptr")
if (c="x64")
DllCall("VirtualProtect", "ptr", p, "ptr", s, "uint", 0x40, "uint*", op)
if (DllCall("crypt32\CryptStringToBinary", "str", m3, "uint", 0, "uint", e[m1], "ptr", p, "uint*", s, "ptr", 0, "ptr", 0))
return p
DllCall("GlobalFree", "ptr", p)
}

_encryptbin(bin1pointer,bin1len,bin2pointer,bin2len){
static encrypt :=_MCode("2,x86:U1VWV4t0JBCLTCQUuAAAAAABzoPuBIsWAcKJFinCAdAPr8KD6QR164tsJByLfCQYi3QkEItMJBSLH7gAAAAAixYBwjHaiRYx2inCAdAPr8KDxgSD6QR154PHBIPtBHXQuAAAAABfXl1bww==,x64:U1ZJicpJidNMidZMidlIAc64AAAAAEiD7gSLFgHCiRYpwgHQD6/CSIPpBHXpuAAAAABBixhMidZMidmLFgHCMdqJFjHaKcIB0A+vwkiDxgRIg+kEdeVJg8AESYPpBHXbuAAAAABeW8M=")
b:=0
loop % bin1len/4
{
a:=NumGet(bin1pointer+0,bin1len-A_Index*4,"uint")
NumPut(a+b,bin1pointer+0,bin1len-A_Index*4,"uint")
b:=(a+b)*a
}
loop % bin2len/4
{
c:=NumGet(bin2pointer+0,(A_Index-1)*4,"uint")
b:=0
loop % bin1len/4
{
a:=NumGet(bin1pointer+0,(A_Index-1)*4,"uint")
NumPut((a+b)^c,bin1pointer+0,(A_Index-1)*4,"uint")
b:=(a+b)*a
}
}
}

_decryptbin(bin1pointer,bin1len,bin2pointer,bin2len){
static decrypt :=_MCode("2,x86:U1VWV4tsJByLfCQYAe+D7wSLH7gAAAAAi3QkEItMJBSLFjHaKcKJFgHQD6/Cg8YEg+kEdeuD7QR11LgAAAAAi3QkEItMJBQBzoPuBIsWKcKJFgHQD6/Cg+kEde24AAAAAF9eXVvD,x64:U1ZJicpJidNNAchJg+gEuAAAAABBixhMidZMidmLFjHaKcKJFgHQD6/CSIPGBEiD6QR16UmD6QR140yJ1kyJ2UgBzrgAAAAASIPuBIsWKcKJFgHQD6/CSIPpBHXruAAAAABeW8M=")

loop % bin2len/4
{
c:=NumGet(bin2pointer+0,bin2len-A_Index*4,"uint")
b:=0
loop % bin1len/4
{
a:=NumGet(bin1pointer+0,(A_Index-1)*4,"uint")
NumPut(a:=(a^c)-b,bin1pointer+0,(A_Index-1)*4,"uint")
b:=(a+b)*a
}
}
b:=0
loop % bin1len/4
{
a:=NumGet(bin1pointer+0,bin1len-A_Index*4,"uint")
NumPut(a:=a-b,bin1pointer+0,bin1len-A_Index*4,"uint")
b:=(a+b)*a
}
}

_crypttobase64(binpointer,binlen)
{
s:=0
DllCall("crypt32\CryptBinaryToStringW","ptr",binpointer,"uint",binlen,"uint",1,"ptr", 0,"uint*",s)
VarSetCapacity(out,s*2,0)
DllCall("crypt32\CryptBinaryToStringW","ptr",binpointer,"uint",binlen,"uint",1,"ptr",&out,"uint*",s)
return StrGet(&out,"utf-16")
}

_cryptfrombase64(string,byref bin)
{
DllCall("crypt32\CryptStringToBinaryW", "wstr",string,"uint",0,"uint",1,"ptr",0,"uint*",s,"ptr",0,"ptr",0)
VarSetCapacity(bin,s,0)
DllCall("crypt32\CryptStringToBinaryW", "wstr",string,"uint",0,"uint",1,"ptr",&bin,"uint*",s,"ptr",0,"ptr",0)
return s
}

;摘自www.autohotkey.com/board, by Welt

;函数调用

;加密(文本,秘钥)
;~ encrypted_pass :=encryptstr("myspassword","my_secret_key")
;~ Clipboard := encrypted_pass
;解密(文本,秘钥)
;~ MsgBox % decryptstr(encrypted_pass,"my_secret_key")

关闭WinRAR出错提示窗口:
loop,360
{
WinClose,诊断信息,中断操作
Sleep,500
}
SetTimer,关闭WinRAR出错提示窗口,Delete
return

19_激活或隐藏窗口WPSOffice日记:
; 1、如果窗口不存在则运行程序
IfWinNotExist,日记
{
IfWinNotExist,C:\Users\Administrator\AppData\Local\Kingsoft\WPS Office\wpsoffice.exe
{
;~ 创建每日新建日记文档
FileCreateDir,D:\d
FileCreateDir,D:\d\每日新建日记
IfNotExist,D:\d\每日新建日记\日记%A_YYYY%%A_MM%%A_DD%.doc
FileCopy,D:\d\每日新建日记\newdoc.doc,D:\d\每日新建日记\日记%A_YYYY%%A_MM%%A_DD%.doc,0
Run,C:\Users\Administrator\AppData\Local\Kingsoft\WPS Office\wpsoffice.exe D:\d\每日新建日记\日记%A_YYYY%%A_MM%%A_DD%.doc
WinWaitActive,日记,,5
Sleep,500
;~ NowTimeString=%A_YYYY%年%A_MM%月%A_DD%日%A_Hour%时%A_Min%分
Send,%A_YYYY%
Sleep,100
Send,年
Sleep,100
Send,%A_MM%
Sleep,100
Send,月
Sleep,100
Send,%A_DD%
Sleep,100
Send,日
Sleep,100
Send,%A_Hour%
Sleep,100
Send,时
Sleep,100
Send,%A_Min%
Sleep,100
Send,分
Sleep,100
Send,{Enter}
Sleep,100
Send,{Enter}
Sleep,100
Send,{Enter}
Sleep,100
Send,{Up}
Sleep,100
Send,{Up}
return
}
else
MsgBox,找不到文件 C:\Users\Administrator\AppData\Local\Kingsoft\WPS Office\wpsoffice.exe
}

; 2、如果窗口置顶并且已经隐藏则显示并激活(切换到)指定窗口
WinGet,WinStyle ,Style,日记
if (not(WinStyle&0x10000000))
{
loop,22
{
WinShow,日记
;~ WinMaximize,日记
WinGet, WinID, ID,日记
DllCall("SwitchToThisWindow", "UInt", WinID, "UInt", 1)
;~ WinActivate,日记
;~ #WinActivateForce
;~ WinActivate,日记
WinGetActiveTitle,WinActiveTitle
; 窗口处于置顶状态, 执行适当的动作.
IfInString,WinActiveTitle,日记
{
;~ MsgBox,%A_Index% 1
return
}
}
}

; 3、如果窗口未置顶则显示并激活(切换到)指定窗口
IfWinNotActive,日记
{
loop,22
{
WinShow,日记
WinMaximize,日记
WinGet, WinID, ID,日记
DllCall("SwitchToThisWindow", "UInt", WinID, "UInt", 1)
WinGetActiveTitle,WinActiveTitle
; 窗口处于置顶状态, 执行适当的动作.
IfInString,WinActiveTitle,日记
{
;~ MsgBox,%A_Index% 2
return
}
}
}

; 4、如果窗口已经显示并置顶则隐藏窗口
WinMinimize,日记
WinHide,日记
return

根据窗口标题激活或者隐藏窗口(VarExeFileName:="EmEditor",VarWinTitle:="EmEditor")
{

; 1、如果程序没有运行则运行程序
Process,Exist,%VarExeFileName%.exe
if (%ErrorLevel%=0)
{
IfWinNotExist,%VarWinTitle%
{
IfExist,D:\Program\%VarExeFileName%\%VarExeFileName%.exe
Run,D:\Program\%VarExeFileName%\%VarExeFileName%.exe
else
MsgBox,找不到文件 D:\Program\%VarExeFileName%\%VarExeFileName%.exe
}
}

; 2、如果窗口置顶并且已经隐藏则显示并激活(切换到)指定窗口

WinGet,WinStyle ,Style,%VarWinTitle%
if (not(WinStyle&0x10000000))
{
loop,22
{
WinShow,%VarWinTitle%
WinMaximize,%VarWinTitle%
WinGet, WinID, ID,%VarWinTitle%
DllCall("SwitchToThisWindow", "UInt", WinID, "UInt", 1)
WinActivate,%VarWinTitle%
#WinActivateForce
WinActivate,%VarWinTitle%
WinGetActiveTitle,WinActiveTitle
; 窗口处于置顶状态, 执行适当的动作.
IfInString,WinActiveTitle,%VarWinTitle%
{
;~ MsgBox,%A_Index% 1
return
}
}
}

; 3、如果窗口未置顶则显示并激活(切换到)指定窗口
IfWinNotActive,ahk_exe %VarExeFileName%.exe
{
loop,22
{
WinShow,%VarWinTitle%
WinMaximize,%VarWinTitle%
WinGet, WinID, ID,%VarWinTitle%
DllCall("SwitchToThisWindow", "UInt", WinID, "UInt", 1)
WinGetActiveTitle,WinActiveTitle
; 窗口处于置顶状态, 执行适当的动作.
IfInString,WinActiveTitle,%VarWinTitle%
{
;~ MsgBox,%A_Index% 2
return
}
}
}

; 4、如果窗口已经显示并置顶则隐藏窗口
WinMinimize,%VarWinTitle%
WinHide,%VarWinTitle%
}

10_激活或隐藏窗口EmEditor:
; 1、如果程序没有运行则运行程序
Process,Exist,EmEditor.exe
if (%ErrorLevel%=0)
{
IfExist,D:\Program\EmEditor\EmEditor.exe
{
Run,D:\Program\EmEditor\EmEditor.exe
}
}

;2、如果窗口没有置顶则显示并激活(切换到)指定窗口
IfWinNotActive,ahk_class EmEditorMainFrame3
{
WinShow,ahk_class EmEditorMainFrame3
WinActivate,ahk_class EmEditorMainFrame3
return
}

;3、如果窗口已经显示并置顶则隐藏窗口
WinHide,ahk_class EmEditorMainFrame3
return

11_激活或隐藏窗口TotalCommander:
根据窗口标题激活或者隐藏窗口("TotalCMD","9.21a")
return


12_激活或隐藏窗口MasterSeeker:
; ----- 1、运行 MasterSeeker 程序
Process,Exist,MasterSeeker.exe
if (%ErrorLevel%=0)
{
IfWinNotExist,ahk_class WindowsForms10.Window.8.app.0.218f99c
{
IfWinNotExist,MasterSeeker 1.5.1 by DxCK ahk_class WindowsForms10.Window.8.app.0.218f99c, statusStri
{
IfExist,D:\Program\MasterSeeker\MasterSeeker.exe
Run,D:\Program\MasterSeeker\MasterSeeker.exe
}
}
}

; ----- 2、显示或隐藏 MasterSeeker 窗口
IfWinNotActive,ahk_class WindowsForms10.Window.8.app.0.218f99c
{
loop,999999
{
;----- 显示窗口
WinShow,ahk_class WindowsForms10.Window.8.app.0.218f99c

;----- 激活窗口
WinGet, WinID, ID,ahk_class WindowsForms10.Window.8.app.0.218f99c
DllCall("SwitchToThisWindow", "UInt", WinID, "UInt", 1)
#WinActivateForce
WinActivate,ahk_class WindowsForms10.Window.8.app.0.218f99c


;----- 检测窗口激活(切换到)是否成功
WinGet,WinActiveID,ID,A
WinGetClass,WinActiveClass,ahk_id %WinActiveID%
; 窗口处于置顶状态, 执行适当的动作.
IfInString,WinActiveClass,WindowsForms10.Window.8.app.0.218f99c
{
Sleep,10
IfWinActive,MasterSeeker 1.5.1 by DxCK ahk_class WindowsForms10.Window.8.app.0.218f99c, statusStri
{
;~ MsgBox,%A_Index%
;----- 全选激活MasterSeeker窗口的搜索编辑框:
loop,3
{
ControlFocus,Filename,ahk_class WindowsForms10.Window.8.app.0.218f99c
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
}
break
}
}

;----- 最大化窗口
;~ WinMaximize,ahk_class WindowsForms10.Window.8.app.0.218f99c

}
else
{
; 4、如果窗口已经显示并置顶则隐藏窗口
WinMinimize,ahk_class WindowsForms10.Window.8.app.0.218f99c
WinHide,ahk_class WindowsForms10.Window.8.app.0.218f99c
}
return

根据窗口类激活或者隐藏窗口(VarExeFileName:="EmEditor",VarClassName:="EmEditor")
{
; 1、如果程序没有运行则运行程序
Process,Exist,%VarExeFileName%.exe
if (%ErrorLevel%=0)
{
IfWinNotExist,ahk_class %VarClassName%
{
;~ MsgBox,%programDir%
;~ IfExist,%ProgramDir%\%VarExeFileName%\%VarExeFileName%.exe
; 我的所有绿色免安装程序都分类保存在文件夹D:\pr中
;一个软件对应于一个以窗口标题命名的专有子文件夹
Run,D:\Program\%VarExeFileName%\%VarExeFileName%.exe
}
}

; 2、如果窗口置顶并且已经隐藏则显示并激活(切换到)指定窗口

WinGet,WinStyle ,Style,ahk_class %VarClassName%
if (not(WinStyle&0x10000000))
{
loop,99
{
WinShow,ahk_class %VarClassName%
WinMaximize,ahk_class %VarClassName%
WinGet, WinID, ID,ahk_class %VarClassName%
DllCall("SwitchToThisWindow", "UInt", WinID, "UInt", 1)
#WinActivateForce
WinActivate,ahk_class %VarClassName%
WinGet,WinActiveID,ID,A
WinGetClass,WinActiveClass,ahk_id %WinActiveID%
; 窗口处于置顶状态, 执行适当的动作.
IfInString,WinActiveClass,%VarClassName%
{
;~ msgbox,%A_Index% 1
return
}
}
}

; 3、如果窗口未置顶则显示并激活(切换到)指定窗口
IfWinNotActive,ahk_exe %VarExeFileName%.exe
{
loop,99
{
WinShow,ahk_class %VarClassName%
WinMaximize,ahk_class %VarClassName%
WinGet, WinID, ID,ahk_class %VarClassName%
DllCall("SwitchToThisWindow", "UInt", WinID, "UInt", 1)
WinActivate,ahk_class %VarClassName%
#WinActivateForce
WinActivate,ahk_class %VarClassName%
WinGet,WinActiveID,ID,A
WinGetClass,WinActiveClass,ahk_id %WinActiveID%
; 窗口处于置顶状态, 执行适当的动作.
IfInString,WinActiveClass,%VarClassName%
{
;~ msgbox,%A_Index% 2
return
}
}
}
; 4、如果窗口已经显示并置顶则隐藏窗口
WinMinimize,ahk_class %VarClassName%
WinHide,ahk_class %VarClassName%
}

13_激活或隐藏窗口Everything:
; 当窗口标题测试不通过的话只好用窗口类了
Process,Close,Everything.exe
根据窗口类激活或者隐藏窗口("Everything","EVERYTHING")
return

14_激活或隐藏窗口SogouExplorer:
根据窗口类激活或者隐藏窗口("SogouExplorer","SE_SogouExplorerFrame")
return

15_激活或隐藏窗口计算器Calc:
Run,calc
return

16_用SciTE4AutoHotkey编辑此脚本:
;唯一办公包内盘927GB的盘符:=搜索唯一办公包内盘927GB并设置盘符()
;if (唯一办公包内盘927GB的盘符<>0)
;{
;Run,D:\Program\AutoHotkey\SciTE\SciTE.exe %A_ScriptName%
;}

IfExist,D:\Program\AutoHotkey\SciTE\SciTE.exe
Run,D:\Program\AutoHotkey\SciTE\SciTE.exe %A_ScriptName%
else
{
ToolTip,找不到文件D:\Program\AutoHotkey\SciTE\SciTE.exe ,% A_ScreenWidth/2-150,% A_ScreenHeight/2-150
SetTimer, 关闭提示窗口,3000
Sleep,3000
}
return

17_激活或隐藏窗口AutoHotkey中文CHM帮助文件:
Run,D:\Program\AutoHotkey\AutoHotkey.CHM
return

18_重启_重新装载运行_此脚本:
Reload
return

 

搜索唯一办公包内盘927GB并设置盘符()
{
找到U盘:=false
DriveGet,盘符清单,List
loop,Parse,盘符清单
{
DriveGet,卷标,Label,%A_LoopField%:
IfInString,卷标,唯一办公包内盘927GB
{
找到U盘:=true
return,%A_LoopField%
}
}
if (not 找到U盘)
{
return,0
}
}

 


08关广告窗口删除广告文件:
;~ 广告弹窗专杀语句格式 WinClose,ahk_exe SohuNews.exe
;~ ;; ;; xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
;~ WinClose,ahk_exe
;~ WinClose,ahk_exe
;~ WinClose,ahk_exe
;~ WinClose,ahk_exe
;~ WinClose,ahk_exe
;~ WinClose,ahk_exe
;~ WinClose,ahk_exe
;~ WinClose,ahk_exe
;~ WinClose,ahk_exe
;~ WinClose,ahk_exe
;~ WinClose,ahk_exe
;~ WinClose,ahk_exe
;~ WinClose,ahk_exe
;~ WinClose,ahk_exe
;~ 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,到期抄报税提示
;; WinClose,USB KEY PIN,请输入KEY的PIN码
return

/*
;--- 在每天 17时05分(下班后)关闭电脑
;~ 09定时关闭电脑:
;~ if A_Hour=17
;~ {
;~ if A_Min=05
;~ {
;~ Run,Shutdown /f /r /t 30
;~ }
;~ }
;~ return
*/

; ### 此AHK脚本结束 #####################################

 

/////////////////////////////////////////////////////////////////////////

 

016、为了避免用“一键GHOST硬盘版”恢复微软公司生产的Windows7专业版操作系统请安装、设置并测试 Shadow Defender 影子卫士

 

 

 

posted @ 2019-04-04 07:53  QQ595076941  阅读(941)  评论(0编辑  收藏  举报
595076941@qq.com