批量復制、安裝和設置電腦軟件的批處理腳本程序源代碼-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.batrem 可以在局域網共享文件夾、RaiDrive連接群暉WebDAV后映射的虛擬磁盤或者銀燦IS903量產U盤USB-CD-ROM中運行此批處理腳本rem 路徑中不可以有空格rem 1、復制批處理腳本所在文件夾中的文件到D:\ProgramStart /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>nulrem 4、設置AHK類型的自動化熱鍵腳本文件的右鍵菜單關聯(新建、運行、編譯、編輯)Start D:/Program/AutoHotkey/RightMenuSetup.ahkrem 作者: 甲殼蟲<jdchenjian@gmail.com>rem 修改作者: 兔子rem 5、運行、顯示、最大化並激活 Total Commander 10.00 程序窗口Start D:\Program\TotalCMD\Run.ahkrem 6、運行並最小化 Everything 程序窗口Start /Min D:\Program\Everything\Everything.exerem 7、運行Maye(快速啟動工具,用於管理和使用快捷方式、rem 設置快捷鍵(TotalCMD設置為F8,Everything設置為F11))Start D:\Program\Maye\Maye.exerem https://blog.arae.cc/post/25830.htmlrem https://github.com/25H/Maya/releases/latestrem https://www.lanzoux.com/b0bqwqjvgexit
D:/Program/AutoHotkey/RightMenuSetup.ahk
/*D:/Program/AutoHotkey/RightMenuSetup.ahkAutoHotkey 版本: 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 曉亮修改 ---#NoEnvSetWorkingDir, %A_ScriptDir%; 管理員權限運行RunWith("admin")#NoEnv#SingleInstance, forceSendMode InputSetWorkingDir %A_ScriptDir%; 版本(僅用於顯示)Script_Version=v1.0.3.2; AutoHotkey 原版的相關信息寫在注冊表HKCR主鍵中,; 嘗試是當前用戶否有權操作該鍵,如果無權操作HKCR鍵(受限用戶),; 可通過操作注冊表HKCU鍵來實現僅當前用戶關聯AHK腳本。IsLimitedUser:=0RegWrite, REG_SZ, HKCR, .testif ErrorLevelIsLimitedUser:=1RegDelete, HKCR, .testif ErrorLevelIsLimitedUser:=1if IsLimitedUser=0 ; 非受限用戶操作HKCR鍵{RootKey=HKCRSubkey=}else ; 受限用戶操作HKCU鍵{RootKey=HKCUSubkey=Software\Classes\ ; <-- 為簡化后面的腳本,此子鍵須以“\”結尾}; 檢查是否存在AHK注冊表項RegRead, FileType, %RootKey%, %Subkey%.ahkif 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 ;模板文件名}elseFileType=AutoHotkeyScriptif AHK_Path={IfExist, %A_ScriptDir%\AutoHotkey.exeAHK_path=%A_ScriptDir%\AutoHotkey.exe}if Editor_Path={IfExist, %A_ScriptDir%\SciTE\SciTE.exeEditor_Path=%A_ScriptDir%\SciTE\SciTE.exe}if Compiler_Path={IfExist, %A_ScriptDir%\Compiler\Ahk2Exe.exeCompiler_Path=%A_ScriptDir%\Compiler\Ahk2Exe.exe}if Template_Name=Template_Name=Template.ahk; --- 20190207 曉亮修改 ---;設置AHK默認文件夾為 D:\Program\AutoHotkeyAHK_path=D:\Program\AutoHotkey\AutoHotkeyU32.exeEditor_Path=D:\Program\AutoHotkey\SciTE\SciTE.exeCompiler_Path=D:\Program\AutoHotkey\Compiler\Ahk2Exe.exeGui, Add, Tab, x10 y10 w480 h250 Choose1, 設置|說明Gui, Tab, 1Gui, Add, GroupBox, x20 y40 w460 h50 , “運行腳本”關聯的 AutoHotkeyGui, 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, 2Gui, Font, boldGui, Add, Text,, AutoHotkey 腳本關聯工具 ScriptSetting %Script_Version%Gui, FontGui, Font, CBlue underlineGui, Add, Text, gWebsite, 作者:甲殼蟲 <jdchenjian@gmail.com>`n`n博客:http://hi.baidu.com/jdchenjianGui, FontGui, Add, Text, w450, 此工具用來修改 AutoHotkey 腳本的右鍵菜單關聯,適用於 AutoHotkey 安裝版、綠色版。Gui, Add, Text, w450, 您可以用它來修改默認腳本編輯器、編譯器,修改默認的新建腳本模板。設置后,在右鍵菜單中添加“運行腳本”、“編輯腳本”、“編譯腳本”和“新建 AutoHotkey 腳本”等選項。Gui, Add, Text, w450, 要取消腳本的系統關聯,請按“卸載”。注意:卸載后您將無法通過雙擊來運行腳本,也不能通過右鍵菜單來啟動腳本編輯器...Gui, TabGui, 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_HANDOnMessage(0x200,"WM_MOUSEMOVE"); --- 20190207 曉亮修改 ---goto,Installreturn; 改變鼠標指針為手形WM_MOUSEMOVE(wParam,lParam){global hCursMouseGetPos,,,,ctrlif ctrl in static2DllCall("SetCursor","UInt",hCurs)return}returnGuiClose:GuiEscape:Cancel:ExitApp; 查找 AutoHotkey 主程序Find_AHK:Gui +OwnDialogsFileSelectFile, AHK_Path, 3, , 查找 AutoHotkey.exe, AutoHotkey.exeif AHK_Path<>GuiControl,,AHK_Path, %AHK_Path%gosub Default_Compilerreturn; 選擇腳本編輯器Choose_Editor:Gui +OwnDialogsFileSelectFile, Editor_Path, 3, , 選擇腳本編輯器, 程序(*.exe)if Editor_Path<>GuiControl,,Editor_Path, %Editor_Path%return; 默認腳本編輯器Default_Editor:IfExist, %A_ScriptDir%\SciTE\SciTE.exeEditor_Path=%A_ScriptDir%\SciTE\SciTE.exeelse ifExist, %A_WinDir%\system32\notepad.exeEditor_Path=%A_WinDir%\system32\notepad.exeGuiControl,, Editor_Path, %Editor_Path%return; 選擇腳本編譯器Choose_Compiler:Gui +OwnDialogsFileSelectFile, Compiler_Path, 3, , 選擇腳本編譯器, 程序(*.exe)if Compiler_Path<>GuiControl,,Compiler_Path, %Compiler_Path%return; 默認腳本編譯器Default_Compiler:GuiControlGet, AHK_PathSplitPath, AHK_Path, ,AHK_DirIfExist, %AHK_Dir%\Compiler\Ahk2Exe.exe{Compiler_Path=%AHK_Dir%\Compiler\Ahk2Exe.exeGuiControl,, Compiler_Path, %Compiler_Path%}return; 設置Install:Gui, SubmitIfNotExist, %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\ShellNewIfExist, %A_WinDir%\ShellNew\%Template_Name%gosub Delete_Template}RegWrite, REG_SZ, %RootKey%, %Subkey%%FileType%,, AutoHotkey 腳本RegWrite, REG_SZ, %RootKey%, %Subkey%%FileType%\DefaultIcon,, %AHK_Path%`,1RegWrite, REG_SZ, %RootKey%, %Subkey%%FileType%\Shell,, OpenRegWrite, 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.exeRegWrite, REG_SZ, %RootKey%, %Subkey%%FileType%\Shell\Compile\Command,, "%Compiler_Path%" /in "`%1"elseRegWrite, 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,USERPROFILEFileCopy,%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_PathIfNotExist, %Editor_Path%{MsgBox, 64, ScriptSetting %Script_Version%, 腳本編輯器路徑錯誤 !return}IfNotExist, %A_WinDir%\ShellNew\%Template_Name%gosub Create_TemplateRun, %Editor_Path% %A_WinDir%\ShellNew\%Template_Name%return; 使編輯腳本模板按鈕有效/無效New_Script:GuiControlGet, New_Scriptif New_Script=0GuiControl, Disable, Edit_TemplateelseGuiControl, Enable, Edit_Templatereturn; 新建腳本模板Create_Template:GuiControlGet, AHK_PathFileGetVersion, AHK_Ver, %AHK_Path%FileAppend,(/*AutoHotkey 版本: %AHK_Ver%操作系統: %A_OSVersion%作者: %A_UserName%網站: http://www.AutoHotkey.com腳本說明:腳本版本: v1.0*/#NoEnvSendMode InputSetWorkingDir `%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/jdchenjianreturn; 從注冊表值字符串中提取路徑PathGetPath(pSourceCmd){local Path, ArgsStartPos = 0if (SubStr(pSourceCmd, 1, 1) = """")Path := SubStr(pSourceCmd, 2, InStr(pSourceCmd, """", false, 2) - 2)else{ArgsStartPos := InStr(pSourceCmd, " ")if ArgsStartPosPath := SubStr(pSourceCmd, 1, ArgsStartPos - 1)elsePath = %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:=0case "Admin","Yes","1": RunAsAdmin:=1case "default": RunAsAdmin:=A_IsAdmindefault: 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.exev:=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, , Dirif (RunAsAdmin=0){; 強制普通權限運行switch, A_IsCompiled{; %A_ScriptFullPath% 必須加引號,否則含空格的路徑會被截斷。%ScriptParameters% 必須不加引號,因為構造時已經加了。; 工作目錄不用單獨指定,默認使用 A_WorkingDir 。case, "1": Run, RunAs.exe /trustlevel:0x20000 "\"%A_ScriptFullPath%\" /restart %ScriptParameters%",, Hidedefault: 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,Ignoreloop,5{DetectHiddenWindows,OnSleep,5IfWinExist,QQ595076941_AutoAHKRunExitApp}Gui, Show, Hide,QQ595076941_AutoAHKRun#Persistent; #NoTrayIconDetectHiddenWindows,OnSetTitleMatchMode,2; 設置激活或者隱藏 Total Commander 10.00 主窗口的快捷鍵為 F8; Hotkey,F8,ActivateOrHideWindowHotkeyActivateOrHideWindowHotkey()return; ——————————————————–ActivateOrHideWindowHotkey(){; MsgBox,PressedHotkey檢測到已經按下快捷鍵Sleep,5IfWinActive,ahk_class TTOTAL_CMD{Sleep,5if(WinActive(ahk_class TTOTAL_CMD)){Sleep,5WinGetClass, MyClass, AIfInString,MyClass,TTOTAL_CMD{Sleep,5IfWinActive,Total Commander{TCTitle:="Total Commander"Sleep,5WinGetActiveTitle,TitleIfInString,Title,%TCTitle%{; MsgBox,MinimizeWindow最小化指定窗口WinMinimize,Total Commander ahk_class TTOTAL_CMDSleep,5ExitApp}}}}}else{; MsgBox,ActivateWindow顯示並且最大化並且激活指定窗口SetTimer,ActivateWindowTimer,20}}; ——————————————————–;根據窗口類名顯示並激活Total Commander窗口ActivateWindowTimer(){; 1、如果程序沒有運行則運行程序,這里我把可執行文件名改成了TotalCMD-v10.exeProcess,Exist,TotalCMD-v10.exeif (%ErrorLevel%=0){IfExist,D:/Program/TotalCMD/TotalCMD.exe{Run,D:/Program/TotalCMD/TotalCMD.exe}else{MsgBox,找不到文件 D:/Program/TotalCMD/TotalCMD.exereturn}}; 2、顯示並激活(切換到)指定窗口WinShow,Total Commander ahk_class TTOTAL_CMDWinMove,Total Commander ahk_class TTOTAL_CMD,,0,0,A_ScreenWidth,A_ScreenHeightWinActivate,Total Commander ahk_class TTOTAL_CMDWinMaximize,Total Commander ahk_class TTOTAL_CMDSleep,5DetectHiddenWindows,OnSetTitleMatchMode,2WinGet, WinID, ID,Total Commander ahk_class TTOTAL_CMDDllCall("SwitchToThisWindow", "UInt", WinID, "UInt", 1); 3、檢查指定窗口是否激活成功,; 假如激活成功則退出Timer計時器循環執行,; 如果激活失敗則繼續嘗試激活指定窗口Sleep,5IfWinActive,ahk_class TTOTAL_CMD{Sleep,5if(WinActive(ahk_class TTOTAL_CMD)){Sleep,5WinGetClass, MyClass, AIfInString,MyClass,TTOTAL_CMD{Sleep,5IfWinActive,Total Commander{TCTitle:="Total Commander"Sleep,5WinGetActiveTitle,TitleIfInString,Title,%TCTitle%{SetTimer,ActivateWindowTimer,DeleteSleep,5ExitApp}}}}}};================= The End =================;/*;================= 根據窗口類名激活或者隱藏窗口的AutoHotkey函數 =================; 請使用 窗口信息工具 AHKInfo 1.3.5 獲取窗口的類名;根據窗口類名激活或者隱藏窗口ActivateOrHideWindow(VarExeFileName:="TotalCMD-v10″,VarWinClassName:="TTOTAL_CMD"){; 1、如果程序沒有運行則運行程序Process,Exist,%VarExeFileName%.exeif (%ErrorLevel%=0){IfExist,%VarExeFileName%.exe{Run,%VarExeFileName%.exereturn}else{MsgBox,找不到文件 %VarExeFileName%.exereturn}}; 2、如果窗口未置頂則顯示並激活(切換到)指定窗口IfWinNotActive,ahk_class %VarWinClassName%{loop,2{Sleep,50WinShow,ahk_class %VarWinClassName%;~ WinMaximize,ahk_class %VarWinClassName%Sleep,50WinGet, WinID, ID,ahk_class %VarWinClassName%Sleep,50DllCall("SwitchToThisWindow", "UInt", WinID, "UInt", 1)}return}; 3、如果窗口已經顯示並置頂則隱藏窗口;~ WinMinimize,ahk_class %VarWinClassName%WinHide,ahk_class %VarWinClassName%}*/;
D:\ProgramSetup\Tree.txt
卷 軟件 的文件夾 PATH 列表卷序列號為 ILOV-EYOUD:.├─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└─圖壓

