Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :: Released under the GNU General Public License version 3 by J2897.
- @echo OFF
- setlocal
- set "ADB=C:\Android\adb.exe"
- REM Make sure ADB is installed.
- if not exist "%ADB%" (
- echo File not found...
- echo %ADB%
- goto :End
- )
- if [%1]==[] (
- echo Drop a shell script on top of this file to run it on your device.
- goto :End
- )
- set "FILENAME=%~nx1"
- set "LOCAL=%1"
- set "REMOTE=/storage/sdcard0/%FILENAME%"
- set "LOG_FILE=ADB Shell Script.log"
- "%ADB%" push "%LOCAL%" "%REMOTE%" || goto :End
- if not exist "%USERPROFILE%\Logs\" (md "%USERPROFILE%\Logs\")
- REM Run interactively.
- :: "%ADB%" shell sh /sdcard/%FILENAME%
- REM Run and write a log file.
- "%ADB%" shell sh /sdcard/%FILENAME% >"%USERPROFILE%\Logs\%LOG_FILE%" 2>&1
- REM Show log file.
- start "" explorer /select,"%USERPROFILE%\Logs\%LOG_FILE%"
- start "" notepad "%USERPROFILE%\Logs\%LOG_FILE%"
- :End
- echo.
- echo Finished!
- echo.
- endlocal
- pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement