Skip to content Skip to sidebar Skip to footer

Execute .bat File From Android

i am trying to execute the xxx.bat file for rename the file from my Android app and hear is my code Runtime.getRuntime().exec(Environment.getExternalStorageDirectory()+File.sepa

Solution 1:

Because .bat is dos batch files, while android based on linux?.. It's 'mv', not 'ren'. It's not '.bat', it's '.sh' (but it doesn't matter, in fact). Also, you have to run /bin/sh and pass script file as parameter, or run 'mv' directly with parameters - you can't exec text file. But i'm sure java have it's own functions to move files, there is no need for shell scripts.


Post a Comment for "Execute .bat File From Android"