高手的方法我不知道,土方法倒是有,先用FileWrite把BAT的内容输出到BAT文件,就你的BAT可以写成:
$cmd = "@echo off" & @CRLF & "cd D:\CRCCheck\Common Tools\Android File Transfer Utility" & @CRLF
$cmd &="ping 127.1 -n 3 1>nul" & @CRLF & "adb devices" & @CRLF & "ping 127.1 -n 5 1>nul" & @CRLF
$cmd &="adb pull /sdcard/Ziistore/app/ \CRCCheck\Exportapk\" & @CRLF & "if %errorlevel%==1 pause"
FileWrite("1.bat",$cmd)
Run("1.bat","",@SW_HIDE)
用INI的话,可以这样:
$dir = IniRead("cfg.ini","CFG","DIR","")
然后把$cmd = "@echo off" & @CRLF & "cd D:\CRCCheck\Common Tools\Android File Transfer Utility" & @CRLF 改成 $cmd = "@echo off" & @CRLF & "cd " & $dir & @CRLF
顺便说一下,其实你这整个BAT貌似也可以用AU3来完成,也就是说根本不用调用BAT
因为不知道你那个ABD用AU3调用会咋样,大概估计一下,用AU3应该可以把你这个BAT改这样
$dir = IniRead("cfg.ini","CFG","DIR","")
FileChangeDir($dir)
Sleep(3000);不明白你PING本机3秒干嘛,不过BAT一般PING自己都是延时,其实这里不延时问题应该也不大吧?
RunWait("ABD.exe devices")
Sleep(5000)
Run("adb.exe pull /sdcard/Ziistore/app/ \CRCCheck\Exportapk\)
水平有限,想到的就这样 |