我不知道读取另一个文件中另一个变量的好方法
FileReader.bat
@echo off
:: Some how read VarX in the ahk file and then save it as another variable
SET VarXReading=%VarX%
echo %VarXReading%
pause
FileToBeRead.ahk
VarX = 69420
您可以将变量作为参数传递给批处理文件。例如
ahk脚本:
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; Do whatever you need to here
VarX := 69420
Run batch.bat %VarX%
批处理脚本:
@echo off
SET VarXReading=%1
echo %VarXReading%
pause
只需确保批处理脚本和ahk脚本在同一目录中即可正常工作
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句