|
本帖最后由 martin313 于 2024-10-1 16:36 编辑
如图所示,只要这2个文件,在同一个目录下,用下述代码,就能顺利执行AB Commander单窗口刷新跳脚!
@echo off
setlocal enabledelayedexpansion
:refresh
:: Define the list of paths and filenames to check
set "paths[0]=X:\Windows\System32\AutoHotkeyU64.exe"
set "paths[1]=X:\Windows\System32\AutoHotkeyU32.exe"
set "paths[2]=X:\Windows\System32\AutoHotkeyA32.exe"
set "paths[3]=X:\Windows\System32\AutoHotkey.exe"
set "paths[4]=X:\Windows\AutoHotkeyU64.exe"
set "paths[5]=X:\Windows\AutoHotkeyU32.exe"
set "paths[6]=X:\Windows\AutoHotkeyA32.exe"
set "paths[7]=X:\Windows\AutoHotkey.exe"
set "paths[8]=X:\Program Files\AutoHotkeyU64.exe"
set "paths[9]=X:\Program Files\AutoHotkeyU32.exe"
set "paths[10]=X:\Program Files\AutoHotkeyA32.exe"
set "paths[11]=X:\Program Files\AutoHotkey.exe"
:: Loop through the paths and try to execute the first existing one
for /L %%i in (0,1,11) do (
set "file=!paths[%%i]!"
if exist "!file!" (
for %%i in ("!file!") do set "dir_path=%%~dpi"
"!file!" "!dir_path!send_ctrl_r.ahk"
goto :EOF
)
)
endlocal
另:
send_ctrl_r.ahk 内容如下:
; 这个脚本在加载时发送Ctrl+R按键消息
Send, ^r
return
|
|