Im tryin to set 2 commands for a folder of apks im trying to push to /system/app/
so what im trying to do is push all apks in a folder to /system/app/ then set a chmod 644 command for those files being pushed
what i have is this to push the apks
for /f %%a IN ('dir /b SystemAPKs\*.apk') do stuff\adb.exe push SystemAPKs\%%a /system/app/
what would be the best way to do this? Thanks
Perform multiple operations in the for loop. Something like this:
for /f %%A IN ('dir /b SystemAPKs\*.apk') do (
stuff\adb.exe push "%%~fA" /system/app/
stuff\adb.exe shell chmod 644 "/system/app/%%~nxA"
)
Update, lets change the working directory of the script. This will allow us to invoke adb with just the file name instead of the entire file path.
Directory Structure
:: Make SystemAPKs the Working Directory
pushd SystemAPKs
for /f %%A IN ('dir /b *.apk') do (
..\stuff\adb.exe push "%%~nxA" /system/app/
..\stuff\adb.exe shell chmod 644 "/system/app/%%~nxA"
)
popd