亚行和CMD没有合作

时间:2014-07-21 14:58:16

标签: android cmd adb hta

我有一个名为KindleSuite(kfsowi.com)的程序

这个HTA程序有一个集成的CMD控制台,它是console.txt 以下是我尝试检查decive的备份是否已经存在,如果是,则恢复它。 如果备份不存在,控制台应该告诉用户然后关闭脚本,而是继续执行还原部分,而这似乎忽略了wait-for-device命令。 任何人都可以告诉我为什么这不能正常运作?

@echo off
if NOT exist resources\scripts\backup\backup.ab (
echo No Backup Available... >resources\console.txt
exit
)
echo Restoring Backup. Please confirm on Kindle's screen...>resources\console.txt
resources\tools\adb wait-for-device restore resources\scripts\backup\backupdata.ab
echo Restore complete. >resources\console.txt
exit

1 个答案:

答案 0 :(得分:0)

我担心我没有看到代码的任何问题,但如果使用IF / ELSE结构,它是否有效?

@echo off
IF NOT EXIST resources\scripts\backup\backup.ab (
echo No Backup Available... >resources\console.txt
exit
) ELSE (
echo Restoring Backup. Please confirm on Kindle's screen...>resources\console.txt
resources\tools\adb wait-for-device restore resources\scripts\backup\backupdata.ab
echo Restore complete. >resources\console.txt
exit
)