i am writing batch script for executing adb commands but while executing "SU" commands only the first commands runs "adb shell" and stops as the script is typing all the commands very fast and not waiting for previous command to run completely so that next command can be entered into the shell window that is "su" example of code is below
:lckscreen
 adb shell
 su
 rm /data/system/gesture.key
 rm /data/system/*.key
 exit
 exit
 pause
 goto menu4
i also tried
adb shell & su 
but still same Result
shell@Samsung_s4:/ $
please help