批量復制、安裝和設置電腦軟件的批處理腳本程序源代碼-2022年1月6日
https://www.autoahk.com/archives/39241
https://www.cnblogs.com/delphixx/p/15771095.html
下載鏈接:
https://www.123pan.com/s/vfk9-dpCn3
https://ds920.lanzoup.com/b01167g5c
密碼: e6c3
我能力有限,無法使用路徑中帶有空格符的 %~dp0
如果有那位網友有完美的帶空格路徑解決方案請在本文最下面的評論區回復一下,謝謝。
D:\ProgramSetup\Setup.bat
rem 批量復制、安裝和設置電腦軟件的批處理腳本程序源代碼-2022年1月6日
rem D:\ProgramSetup\Setup.bat
rem 可以在局域網共享文件夾、RaiDrive連接群暉WebDAV后映射的虛擬磁盤或者銀燦IS903量產U盤USB-CD-ROM中運行此批處理腳本
rem 路徑中不可以有空格
rem 1、復制批處理腳本所在文件夾中的文件到D:\Program
Start /Wait Robocopy.exe %~dp0 D:\Program\ /e /mt /r:3 /w:3 *.*
rem 2、全自動靜默安裝AutoHotkey自動化熱鍵腳本編程環境
Start /Wait D:/Program/AutoHotkey/AutoHotkey_1.1.33.10_setup.exe /S /A32 /U32 /U64 /D=D:/Program/AutoHotkey/
rem 3、等待3秒鍾
ping -n 3 127.0.0.1>nul 2>nul
rem 4、設置AHK類型的自動化熱鍵腳本文件的右鍵菜單關聯(新建、運行、編譯、編輯)
Start D:/Program/AutoHotkey/RightMenuSetup.ahk
rem 作者: 甲殼蟲<jdchenjian@gmail.com>
rem 修改作者: 兔子
rem 5、運行、顯示、最大化並激活 Total Commander 10.00 程序窗口
Start D:\Program\TotalCMD\Run.ahk
rem 6、運行並最小化 Everything 程序窗口
Start /Min D:\Program\Everything\Everything.exe
rem 7、運行Maye(快速啟動工具,用於管理和使用快捷方式、
rem 設置快捷鍵(TotalCMD設置為F8,Everything設置為F11))
Start D:\Program\Maye\Maye.exe
rem https://blog.arae.cc/post/25830.html
rem https://github.com/25H/Maya/releases/latest
rem https://www.lanzoux.com/b0bqwqjvg
exit
D:/Program/AutoHotkey/RightMenuSetup.ahk
/*
D:/Program/AutoHotkey/RightMenuSetup.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
SetWorkingDir, %A_ScriptDir%
; 管理員權限運行
RunWith("admin")
#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
}
; 強制自身進程以 管理員權限 或 普通權限 或 ANSI 或 U32 或 U64 版本運行。
; 例1: runwith("admin","u32") 強制自身以 u32 + 管理員權限 運行。
; 例2: runwith("","ansi") 強制自身以 ansi 版本運行(權限不變)。
; 例3: runwith("normal") 強制自身以 普通權限 運行(版本不變)。
RunWith(RunAsAdmin:="Default", ANSI_U32_U64:="Default")
{
; 格式化預期的模式
switch, RunAsAdmin
{
case "Normal","Standard","No","0": RunAsAdmin:=0
case "Admin","Yes","1": RunAsAdmin:=1
case "default": RunAsAdmin:=A_IsAdmin
default: RunAsAdmin:=A_IsAdmin
}
switch, ANSI_U32_U64
{
case "A32","ANSI","A": ANSI_U32_U64:="AutoHotkeyA32.exe"
case "U32","X32","32": ANSI_U32_U64:="AutoHotkeyU32.exe"
case "U64","X64","64": ANSI_U32_U64:="AutoHotkeyU64.exe"
case "default": ANSI_U32_U64:="AutoHotkey.exe"
default: ANSI_U32_U64:="AutoHotkey.exe"
}
; 獲取傳遞給 “.ahk” 的用戶參數(不是 /restart 之類傳遞給 “.exe” 的開關參數)
for k, v in A_Args
{
if (RunAsAdmin=1)
{
; 轉義所有的引號與轉義符號
v:=StrReplace(v, "\", "\\")
v:=StrReplace(v, """", "\""")
; 無論參數中是否有空格,都給參數兩邊加上引號
; Run 的內引號是 "
ScriptParameters .= (ScriptParameters="") ? """" v """" : A_Space """" v """"
}
else
{
; 轉義所有的引號與轉義符號
; 注意要轉義兩次 Run 和 RunAs.exe
v:=StrReplace(v, "\", "\\")
v:=StrReplace(v, """", "\""")
v:=StrReplace(v, "\", "\\")
v:=StrReplace(v, """", "\""")
; 無論參數中是否有空格,都給參數兩邊加上引號
; RunAs.exe 的內引號是 \"
ScriptParameters .= (ScriptParameters="") ? "\""" v "\""" : A_Space "\""" v "\"""
}
}
; 判斷當前 exe 是什么版本
if (!A_IsUnicode)
RunningEXE:="AutoHotkeyA32.exe"
else if (A_PtrSize=4)
RunningEXE:="AutoHotkeyU32.exe"
else if (A_PtrSize=8)
RunningEXE:="AutoHotkeyU64.exe"
; 運行模式與預期相同,則直接返回。 ANSI_U32_U64="AutoHotkey.exe" 代表不對 ahk 版本做要求。
if (A_IsAdmin=RunAsAdmin and (ANSI_U32_U64="AutoHotkey.exe" or ANSI_U32_U64=RunningEXE))
return
; 如果當前已經是使用 /restart 參數重啟的進程,則報錯避免反復重啟導致死循環。
else if (RegExMatch(DllCall("GetCommandLine", "str"), " /restart(?!\S)"))
{
預期權限:=(RunAsAdmin=1) ? "管理員權限" : "普通權限"
當前權限:=(A_IsAdmin=1) ? "管理員權限" : "普通權限"
ErrorMessage=
(LTrim
預期使用: %ANSI_U32_U64%
當前使用: %RunningEXE%
預期權限: %預期權限%
當前權限: %當前權限%
程序即將退出。
)
MsgBox 0x40030, 運行狀態與預期不一致, %ErrorMessage%
ExitApp
}
else
{
; 獲取 AutoHotkey.exe 的路徑
SplitPath, A_AhkPath, , Dir
if (RunAsAdmin=0)
{
; 強制普通權限運行
switch, A_IsCompiled
{
; %A_ScriptFullPath% 必須加引號,否則含空格的路徑會被截斷。%ScriptParameters% 必須不加引號,因為構造時已經加了。
; 工作目錄不用單獨指定,默認使用 A_WorkingDir 。
case, "1": Run, RunAs.exe /trustlevel:0x20000 "\"%A_ScriptFullPath%\" /restart %ScriptParameters%",, Hide
default: Run, RunAs.exe /trustlevel:0x20000 "\"%Dir%\%ANSI_U32_U64%\" /restart \"%A_ScriptFullPath%\" %ScriptParameters%",, Hide
}
}
else
{
; 強制管理員權限運行
switch, A_IsCompiled
{
; %A_ScriptFullPath% 必須加引號,否則含空格的路徑會被截斷。%ScriptParameters% 必須不加引號,因為構造時已經加了。
; 工作目錄不用單獨指定,默認使用 A_WorkingDir 。
case, "1": Run, *RunAs "%A_ScriptFullPath%" /restart %ScriptParameters%
default: Run, *RunAs "%Dir%\%ANSI_U32_U64%" /restart "%A_ScriptFullPath%" %ScriptParameters%
}
}
ExitApp
}
}
D:\Program\TotalCMD\Run.ahk
;
;/*
; D:\Program\TotalCMD\Run.ahk
;===========================================
; 設置激活或者隱藏 Total Commander 10.00 主窗口的快捷鍵為 F8
; https://www.autoahk.com/archives/37780
; https://www.cnblogs.com/delphixx/p/15718194.html
;
; 腳本作者 : ds920
; 最新版本 : 1.1
; 更新時間 : 2021年12月22日
;
; 用法: (需要最新版本 AHK v1.1.31+)
; 1. 到飛揚時空的新浪博客下載並安裝TotalCommander中文增強版到文件夾D:/TotalCMD
; 2. 將本腳本保存為"RunTC.ahk"並復制到D:/TotalCMD文件夾中
; 3. 使用Maye來設置RunTC.ahk的熱鍵為 F8
;
; 升級更新歷史:
; 版本1.0 2021年12月22日 新建 創建此AutoHotkey腳本並測試通過F8熱鍵功能
; 版本1.1 2021年12月22日 修改 調整刪除 SetTimer 定時器時判斷TC主窗口是否激活的順序
; 把基於窗口類的激活判斷語句"if(WinActive("ahk_class" TTOTAL_CMD))"放在最外層
; 防止有相同標題的窗口激活時(例如:相同標題的瀏覽器等等)窗口激活誤判
;
; 由於AutoHotkey的Hotkey語句設置的熱鍵必需在任務欄或者桌面進程激活時才有效,
; 所以請使用Maye來設置Total Commander的熱鍵 F8
; https://blog.arae.cc/post/25830.html
; https://github.com/25H/Maya/releases/
;
; 可以用 Total Commander 訪問用RaiDrive異地遠程連接群暉WebDAV文件服務並映射成的本地虛擬磁盤盤符 Z: 分區
; 可以用 Total Commander 訪問用NetDrive2異地遠程連接群暉SFTP文件服務並映射成的本地虛擬磁盤盤符 Y: 分區
; 可以用支持 Total Commander的WebDAV文件服務訪問插件異地遠程連接群暉WebDAV文件服務中的網絡共享文件夾
; 可以用KeePass或者KeePass2Android來連接堅果雲或者
; 群暉NAS的WebDAV文件服務來管理網址、用戶名、賬號、密碼、口令、暗號、紀念日等個人敏感隱私信息和數據
; 可以用FileZilla Pro 專業版軟件異地遠程連接群暉的WebDAV文件服務並
; 批量上傳文件夾到群暉的 RAID 1 鏡像存儲池中的共享文件夾之中
; 可以用騰訊文檔的電腦客戶端來新建在線文檔和在線表格來進行辦公文檔和辦公表格的分享和協作
; 可以用Bulk Rename Utility 2.7.1.2來批量重命名或者編號群暉WebDAV文件服務中的共享文件夾中的大量文件
; 可以用Double Killer Pro V 2.1.0.104來批量刪除群暉WebDAV文件服務中的共享文件夾中的重復文件
; 可以安裝並升級更新"火絨安全軟件"來防殺電腦病毒木馬惡意軟件並攔截垃圾廣告彈出的騷擾窗口
; 可以用SGI備份還原映像總裁鏡像總裁一鍵還原工具軟件來備份保護Windows操作系統和
; 電腦中應用程序軟件和設置到GHO系統鏡像文件
; SGI備份還原映像總裁鏡像總裁一鍵還原工具軟件官方網址是 https://www.sysceo.com/Software-softwarei-id-253.html
; 以便今后用杏雨梨雲啟動維護系統可啟動固態U盤來恢復電腦系統應用程序軟件GHO系統鏡像文件到電腦的系統分區C盤
; 可以用Shadow Defender 影子衛士來保護Windows操作系統和電腦中應用程序軟件的設置,
; 防止電腦軟件設置被未授權的用戶和程序非法更改和破壞
; 如果無法安裝 Shadow Defender 影子衛士時可以用"DeepFreeze冰點還原精靈"或者
; "PowerShadow影子系統"或者"Returnil Virtual System(RVS)"來代替影子衛士
;
;===========================================
;*/
#SingleInstance,Ignore
loop,5
{
DetectHiddenWindows,On
Sleep,5
IfWinExist,QQ595076941_AutoAHKRun
ExitApp
}
Gui, Show, Hide,QQ595076941_AutoAHKRun
#Persistent
; #NoTrayIcon
DetectHiddenWindows,On
SetTitleMatchMode,2
; 設置激活或者隱藏 Total Commander 10.00 主窗口的快捷鍵為 F8
; Hotkey,F8,ActivateOrHideWindowHotkey
ActivateOrHideWindowHotkey()
return
; ——————————————————–
ActivateOrHideWindowHotkey()
{
; MsgBox,PressedHotkey檢測到已經按下快捷鍵
Sleep,5
IfWinActive,ahk_class TTOTAL_CMD
{
Sleep,5
if(WinActive(ahk_class TTOTAL_CMD))
{
Sleep,5
WinGetClass, MyClass, A
IfInString,MyClass,TTOTAL_CMD
{
Sleep,5
IfWinActive,Total Commander
{
TCTitle:="Total Commander"
Sleep,5
WinGetActiveTitle,Title
IfInString,Title,%TCTitle%
{
; MsgBox,MinimizeWindow最小化指定窗口
WinMinimize,Total Commander ahk_class TTOTAL_CMD
Sleep,5
ExitApp
}
}
}
}
}
else
{
; MsgBox,ActivateWindow顯示並且最大化並且激活指定窗口
SetTimer,ActivateWindowTimer,20
}
}
; ——————————————————–
;根據窗口類名顯示並激活Total Commander窗口
ActivateWindowTimer()
{
; 1、如果程序沒有運行則運行程序,這里我把可執行文件名改成了TotalCMD-v10.exe
Process,Exist,TotalCMD-v10.exe
if (%ErrorLevel%=0)
{
IfExist,D:/Program/TotalCMD/TotalCMD.exe
{
Run,D:/Program/TotalCMD/TotalCMD.exe
}
else
{
MsgBox,找不到文件 D:/Program/TotalCMD/TotalCMD.exe
return
}
}
; 2、顯示並激活(切換到)指定窗口
WinShow,Total Commander ahk_class TTOTAL_CMD
WinMove,Total Commander ahk_class TTOTAL_CMD,,0,0,A_ScreenWidth,A_ScreenHeight
WinActivate,Total Commander ahk_class TTOTAL_CMD
WinMaximize,Total Commander ahk_class TTOTAL_CMD
Sleep,5
DetectHiddenWindows,On
SetTitleMatchMode,2
WinGet, WinID, ID,Total Commander ahk_class TTOTAL_CMD
DllCall("SwitchToThisWindow", "UInt", WinID, "UInt", 1)
; 3、檢查指定窗口是否激活成功,
; 假如激活成功則退出Timer計時器循環執行,
; 如果激活失敗則繼續嘗試激活指定窗口
Sleep,5
IfWinActive,ahk_class TTOTAL_CMD
{
Sleep,5
if(WinActive(ahk_class TTOTAL_CMD))
{
Sleep,5
WinGetClass, MyClass, A
IfInString,MyClass,TTOTAL_CMD
{
Sleep,5
IfWinActive,Total Commander
{
TCTitle:="Total Commander"
Sleep,5
WinGetActiveTitle,Title
IfInString,Title,%TCTitle%
{
SetTimer,ActivateWindowTimer,Delete
Sleep,5
ExitApp
}
}
}
}
}
}
;================= The End =================
;
/*
;================= 根據窗口類名激活或者隱藏窗口的AutoHotkey函數 =================
; 請使用 窗口信息工具 AHKInfo 1.3.5 獲取窗口的類名
;根據窗口類名激活或者隱藏窗口
ActivateOrHideWindow(VarExeFileName:="TotalCMD-v10″,VarWinClassName:="TTOTAL_CMD")
{
; 1、如果程序沒有運行則運行程序
Process,Exist,%VarExeFileName%.exe
if (%ErrorLevel%=0)
{
IfExist,%VarExeFileName%.exe
{
Run,%VarExeFileName%.exe
return
}
else
{
MsgBox,找不到文件 %VarExeFileName%.exe
return
}
}
; 2、如果窗口未置頂則顯示並激活(切換到)指定窗口
IfWinNotActive,ahk_class %VarWinClassName%
{
loop,2
{
Sleep,50
WinShow,ahk_class %VarWinClassName%
;~ WinMaximize,ahk_class %VarWinClassName%
Sleep,50
WinGet, WinID, ID,ahk_class %VarWinClassName%
Sleep,50
DllCall("SwitchToThisWindow", "UInt", WinID, "UInt", 1)
}
return
}
; 3、如果窗口已經顯示並置頂則隱藏窗口
;~ WinMinimize,ahk_class %VarWinClassName%
WinHide,ahk_class %VarWinClassName%
}
*/
;
D:\ProgramSetup\Tree.txt
卷 軟件 的文件夾 PATH 列表
卷序列號為 ILOV-EYOU
D:.
├─AutoHotkey
│ ├─AHK電子書
│ ├─Compiler
│ ├─Icon
│ └─SciTE
│ ├─extensions
│ ├─locales
│ ├─toolbar
│ │ └─Lib
│ ├─tools
│ │ ├─AHK 正則終結者
│ │ │ └─Lib
│ │ ├─AHK 爬蟲終結者
│ │ │ ├─jsoneditor-5.15.0
│ │ │ │ └─dist
│ │ │ │ └─img
│ │ │ └─Lib
│ │ ├─AHK 腳本關聯工具
│ │ ├─AHK-Rare
│ │ │ ├─assets
│ │ │ ├─lib
│ │ │ │ └─Highlighters
│ │ │ └─tools
│ │ ├─ahkinfo
│ │ ├─AhkSpy
│ │ ├─AHK_Window_Info
│ │ ├─Au3Record
│ │ ├─Auto-GUI
│ │ │ ├─Constantine
│ │ │ ├─Icons
│ │ │ ├─Include
│ │ │ ├─Lib
│ │ │ └─Settings
│ │ ├─Auto-Syntax-Tidy
│ │ │ └─Syntax
│ │ ├─AutoItMacroGenerator
│ │ ├─AutoScriptWriter
│ │ ├─CLISD
│ │ ├─ColorFinder
│ │ │ └─Lib
│ │ ├─eXeScope
│ │ ├─FindText
│ │ ├─GenDocs
│ │ │ ├─Demo
│ │ │ └─Lib
│ │ ├─iCodeRepository3
│ │ │ ├─Clipboard_monitor
│ │ │ ├─help
│ │ │ │ └─pictures
│ │ │ └─愛碼源碼倉庫
│ │ │ ├─AutoHotkey
│ │ │ └─AutoHotkey2
│ │ ├─Lib
│ │ │ └─DebugVars
│ │ ├─MacroCreator
│ │ │ ├─Documentation
│ │ │ │ ├─Lib
│ │ │ │ └─MacroCreator_Help-doc
│ │ │ │ ├─Examples
│ │ │ │ └─Images
│ │ │ ├─Lang
│ │ │ ├─LIB
│ │ │ └─Resources
│ │ │ └─Icons
│ │ ├─MagicBox
│ │ │ ├─Examples
│ │ │ ├─Functions
│ │ │ ├─Icons
│ │ │ ├─Lib
│ │ │ └─Settings
│ │ ├─SciTE交互示例
│ │ ├─SmartGUI
│ │ ├─Spy++
│ │ ├─TestSuite
│ │ ├─ViewWizard
│ │ ├─WindowSpy
│ │ ├─智能操作
│ │ └─自動更新
│ ├─user
│ │ ├─Extensions
│ │ ├─Macros
│ │ ├─Scriptlets
│ │ ├─Settings
│ │ └─Styles
│ ├─中文幫助
│ └─技巧
├─Everything
├─FileZillaPro
│ ├─Data
│ ├─docs
│ ├─filezillacfg
│ ├─KeePass
│ │ ├─Languages
│ │ ├─Plugins
│ │ └─XSL
│ ├─locales
│ │ ├─an
│ │ ├─ar
│ │ ├─az
│ │ ├─bg_BG
│ │ ├─ca
│ │ ├─ca_ES@valencia
│ │ ├─co
│ │ ├─cs_CZ
│ │ ├─cy
│ │ ├─da
│ │ ├─de
│ │ ├─el
│ │ ├─es
│ │ ├─et
│ │ ├─eu
│ │ ├─fa_IR
│ │ ├─fi_FI
│ │ ├─fr
│ │ ├─gl_ES
│ │ ├─he_IL
│ │ ├─hr
│ │ ├─hu_HU
│ │ ├─hy
│ │ ├─id_ID
│ │ ├─is
│ │ ├─it
│ │ ├─ja_JP
│ │ ├─ka
│ │ ├─kab
│ │ ├─km_KH
│ │ ├─ko_KR
│ │ ├─ku
│ │ ├─ky
│ │ ├─lo_LA
│ │ ├─lt_LT
│ │ ├─lv_LV
│ │ ├─mk_MK
│ │ ├─nb_NO
│ │ ├─ne
│ │ ├─nl
│ │ ├─nn_NO
│ │ ├─oc
│ │ ├─pl_PL
│ │ ├─pt_BR
│ │ ├─pt_PT
│ │ ├─ro_RO
│ │ ├─ru
│ │ ├─sk_SK
│ │ ├─sl_SI
│ │ ├─sr
│ │ ├─sv
│ │ ├─ta
│ │ ├─th_TH
│ │ ├─tr
│ │ ├─uk_UA
│ │ ├─vi_VN
│ │ ├─zh_CN
│ │ └─zh_TW
│ ├─resources
│ │ ├─16x16
│ │ ├─20x20
│ │ ├─24x24
│ │ ├─32x32
│ │ ├─480x480
│ │ ├─48x48
│ │ ├─blukis
│ │ │ ├─16x16
│ │ │ ├─32x32
│ │ │ └─48x48
│ │ ├─classic
│ │ │ └─16x16
│ │ ├─cyril
│ │ │ └─16x16
│ │ ├─default
│ │ │ └─480x480
│ │ ├─flatzilla
│ │ │ ├─16x16
│ │ │ ├─24x24
│ │ │ ├─32x32
│ │ │ └─48x48
│ │ ├─lone
│ │ │ ├─16x16
│ │ │ ├─32x32
│ │ │ └─48x48
│ │ ├─minimal
│ │ │ ├─16x16
│ │ │ └─32x32
│ │ ├─opencrystal
│ │ │ ├─16x16
│ │ │ ├─20x20
│ │ │ ├─24x24
│ │ │ ├─32x32
│ │ │ └─48x48
│ │ ├─sun
│ │ │ └─48x48
│ │ ├─tango
│ │ │ ├─16x16
│ │ │ ├─32x32
│ │ │ └─48x48
│ │ └─xrc
│ └─手動復制備份的配置和數據文件
│ ├─7z1900
│ ├─7zSfxTool
│ │ ├─Plugin
│ │ └─SFX 模塊
│ └─TrafficMonitor顯示電腦網速監控懸浮窗
│ ├─Logo
│ └─skins
│ ├─0默認皮膚
│ ├─皮膚01
│ ├─皮膚02
│ ├─皮膚03
│ ├─皮膚04
│ ├─皮膚05
│ ├─皮膚06
│ ├─皮膚07
│ ├─皮膚08
│ ├─皮膚09
│ ├─皮膚10
│ ├─皮膚11
│ └─皮膚12
├─FolderSizes
├─FSCapture
│ └─Languages
├─Hash
├─IObitUnlocker
├─JexChan
├─KeePass
│ ├─Languages
│ ├─Plugins
│ └─XSL
├─Maye
│ ├─bak
│ ├─cache
│ │ ├─icon
│ │ └─search
│ └─skin
├─PowerOff
├─Robocopy
├─SGI
├─TotalCMD
│ ├─Cache
│ ├─Filter32
│ ├─Language
│ └─User
├─TrafficMonitor
│ ├─Logo
│ └─skins
│ ├─0默認皮膚
│ ├─皮膚01
│ ├─皮膚02
│ ├─皮膚03
│ ├─皮膚04
│ ├─皮膚05
│ ├─皮膚06
│ ├─皮膚07
│ ├─皮膚08
│ ├─皮膚09
│ ├─皮膚10
│ ├─皮膚11
│ └─皮膚12
├─WizTree
│ ├─locale
│ │ ├─bg
│ │ │ └─LC_MESSAGES
│ │ ├─da
│ │ │ └─LC_MESSAGES
│ │ ├─de
│ │ │ └─LC_MESSAGES
│ │ ├─el
│ │ │ └─LC_MESSAGES
│ │ ├─en
│ │ │ └─LC_MESSAGES
│ │ ├─es
│ │ │ └─LC_MESSAGES
│ │ ├─fr
│ │ │ └─LC_MESSAGES
│ │ ├─hu
│ │ │ └─LC_MESSAGES
│ │ ├─it
│ │ │ └─LC_MESSAGES
│ │ ├─ja
│ │ │ └─LC_MESSAGES
│ │ ├─ko
│ │ │ └─LC_MESSAGES
│ │ ├─nl
│ │ │ └─LC_MESSAGES
│ │ ├─no
│ │ │ └─LC_MESSAGES
│ │ ├─pl
│ │ │ └─LC_MESSAGES
│ │ ├─pt_BR
│ │ │ └─LC_MESSAGES
│ │ ├─ru
│ │ │ └─LC_MESSAGES
│ │ ├─sk
│ │ │ └─LC_MESSAGES
│ │ ├─sr
│ │ │ └─LC_MESSAGES
│ │ ├─sv
│ │ │ └─LC_MESSAGES
│ │ ├─tr
│ │ │ └─LC_MESSAGES
│ │ ├─uk
│ │ │ └─LC_MESSAGES
│ │ ├─zh_CHS
│ │ │ └─LC_MESSAGES
│ │ └─zh_CHT
│ │ └─LC_MESSAGES
│ └─log
├─_Fix
│ └─局域網共享
│ └─備用版本-一鍵設置局域網共享
├─_Setup
│ ├─DeepFreeze
│ │ ├─360文件解鎖
│ │ │ ├─Config
│ │ │ │ └─defaultskin
│ │ │ ├─MINI
│ │ │ └─Utils
│ │ └─LockHunter32
│ ├─FastCopy
│ │ └─doc
│ ├─NetDrive2
│ ├─ShadowDefender
│ └─WebDrive
└─圖壓