Announcement

Collapse
No announcement yet.

start android VMLite VNC SERVER via usb to windows using adb(adndroid debug bridge)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • start android VMLite VNC SERVER via usb to windows using adb(adndroid debug bridge)

    This batch process will likely handle as many android tablets as can you hook up to one windows computer.

    VMLite VNC Server is a commercial VNC server software for Android. I am using Samsung tablets of the lower cost.
    After trying to root a couple of tablets, I decided not to do that if I did not have too. The are basically bricked.
    This VNC server software is suppose to be able to start on its own with a rooted android and cannot if it is not.
    This batch file is to start more than one VMlite VNC server each of different tablets connected by USB.
    I tried to stay with batch routines that should be common on most windows NT machines.
    I have not found the best VNC client software yet but doing standard VNC is getting better.
    Also commercial Alpha VNC Lite SERVER has really improved which it has not problems starting and stopping and startup on bootup too.
    But it was rough in the beginning.

    You can control an IOS device, I hear with an Apple MAC OSX product. There went the IPAD option.

    WNDWINST and SLEEP should be in this forum

    startvmlite.bat
    Code:
    @ECHO OFF
    TITLE STARTVMLITE
    WNDWINST STARTVMLITE                                                                                                                                      
    IF %ERRORLEVEL% EQU 2 EXIT
    
    c:
    CD \
    IF NOT EXIST C:\WSBAT MD C:\WSBAT > NUL:
    CD \WSBAT
    IF EXIST adbdevices.txt del adbdevices.txt > nul:
    IF EXIST devices.txt del devices.txt > nul:
    
    IF NOT EXIST C:\ADB\ADB.EXE GOTO ABORT
    IF NOT EXIST replace.vbs GOTO ABORT
    C:\ADB\adb kill-server
    C:\ADB\adb devices > adbdevices.txt
    
    IF NOT EXIST  adbdeviceS.txt GOTO ABORT
    ECHO. STOP     device >> adbdevices.txt
    findstr /E /I " device" adbdevices.txt > devices.txt
    
    IF NOT EXIST  devices.txt GOTO ABORT
    ECHO. STOP   device >> devices.txt
    
    if NOT EXIST devices.txt GOTO ABORT
    cscript replace.vbs devices.txt "device" ""
    
    if NOT EXIST devices.txt GOTO ABORT
    cscript replace.vbs devices.txt " " ""
    
    if NOT EXIST devices.txt GOTO ABORT
    for /F "tokens=*" %%A in  (devices.txt) do (
    CALL :STARTVMLITE  %%A
    )
    
    GOTO END
    
    :STARTVMLITE
    CLS
    IF "%1" == "STOP" del adbdevices.txt > nul:
    IF "%1" == "STOP" del devices.txt > nul:
    IF "%1" == "STOP" EXIT /B 0
    CLS
    C:\ADB\adb -s "%1" shell "am start -a android.intent.action.MAIN -n com.vmlite.vncserver/.MainActivity"
    start "VMLITEVNCSTART" C:\ADB\adb -s "%1" shell /data/data/com.vmlite.vncserver/files/vmlitevncserver
    SLEEP 4
    TASKKILL /F /FI "WINDOWTITLE eq VMLITEVNCSTART"
    EXIT /B 0
    
    :ABORT
    :END
    CLS
    IF EXIST adbdevices.txt del adbdevices.txt > nul:
    IF EXIST devices.txt del devices.txt > nul:
    CLS
    EXIT
    replace.vbs
    Code:
    Const ForReading = 1    
    Const ForWriting = 2
    
    strFileName = Wscript.Arguments(0)
    strOldText = Wscript.Arguments(1)
    strNewText = Wscript.Arguments(2)
    
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.OpenTextFile(strFileName, ForReading)
    strText = objFile.ReadAll
    objFile.Close
    
    strNewText = Replace(strText, strOldText, strNewText)
    Set objFile = objFSO.OpenTextFile(strFileName, ForWriting)
    objFile.Write strNewText  'WriteLine adds extra CR/LF
    objFile.Close
    p purvis
Working...
X