Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: luanch of executable from within .bat file fails  (Read 18169 times)

0 Members and 1 Guest are viewing this topic.

Squashman



    Specialist
  • Thanked: 134
  • Experience: Experienced
  • OS: Other
Re: luanch of executable from within .bat file fails
« Reply #30 on: November 30, 2014, 08:34:21 PM »
OP = Original Poster.

Geek-9pm


    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: luanch of executable from within .bat file fails
« Reply #31 on: November 30, 2014, 08:35:59 PM »
Jerry, you are the OP.
Sorry I was late to update my post.
The SDK 23.0.4 was bad.
https://code.google.com/p/android/issues/detail?id=77289
Specifically, it is the version of find_jave that does not work right. That is what the Google link above claims. If so, you just need to use the good version of find_java and it should work.
The are dozens, maybe hundreds of posts about this problem.
Hope that is the real problem.
« Last Edit: November 30, 2014, 08:46:24 PM by Geek-9pm »

foxidrive



    Specialist
  • Thanked: 268
  • Experience: Experienced
  • OS: Windows 8
Re: luanch of executable from within .bat file fails
« Reply #32 on: November 30, 2014, 10:21:54 PM »
D:\dev\android\sdk\tools\lib>testme
'"D:\dev\android\sdk\tools\lib\\find_java.exe" -s' is not recognized as an internal or external command,
operable program or batch file.
Press any key to continue . . .

Change the code in the same batch file and try this:

Code: [Select]
@echo off
find_java.exe -s
pause


Jerry Ford

    Topic Starter


    Rookie

    • Experience: Expert
    • OS: Windows 7
    Re: luanch of executable from within .bat file fails
    « Reply #33 on: December 01, 2014, 10:58:52 AM »
    Geek-9pm:

    The issue referenced in the Google link you provided is not the same as my issue.  That issue report shows a different error message than the one I'm getting...

    They get "This version of C:\Program Files\Android SDK\tools\lib\find_java.exe is not compatible with the version of Windows you're running", I get  "D:\dev\android\sdk\tools\lib\\find_java.exe" -s' is not recognized as an internal or external command".

    Also, their issue seems to stem from a not yet publicly released dev build of the SDK, build  23.0.4.  I'm using the build that is still the only one available at Google's SDK download page, build 23.0.2. The fix recommended for this issue on Stackoverflow is to revert to the SDK version that I'm using.

    foxidrive:

    Okay, I put the echo statement into the bat file; this is what I get...

    D:\dev\android\sdk\tools\lib>testme
    '"D:\dev\android\sdk\tools\lib\\find_java.exe" -s' is not recognized as an internal or external command,
    operable program or batch file.
    Press any key to continue . . .

    Jerry

    Squashman



      Specialist
    • Thanked: 134
    • Experience: Experienced
    • OS: Other
    Re: luanch of executable from within .bat file fails
    « Reply #34 on: December 01, 2014, 11:33:51 AM »

    Okay, I put the echo statement into the bat file; this is what I get...

    D:\dev\android\sdk\tools\lib>testme
    '"D:\dev\android\sdk\tools\lib\\find_java.exe" -s' is not recognized as an internal or external command,
    operable program or batch file.
    Press any key to continue . . .

    Jerry
    He asked you to put those exact 3 lines into the batch file and then run it.  The output would be different if you had.

    Jerry Ford

      Topic Starter


      Rookie

      • Experience: Expert
      • OS: Windows 7
      Re: luanch of executable from within .bat file fails
      « Reply #35 on: December 01, 2014, 01:07:02 PM »
      Squashman:

      I don't follow.  His original request was to create a testme.bat, consisting of...

      @echo off
      for /f "delims=" %%a in ('"%~dps0\find_java.exe" -s') do echo "%%a"
      pause

      I did so, and got...

      D:\dev\android\sdk\tools\lib>testme
      '"D:\dev\android\sdk\tools\lib\\find_java.exe" -s' is not recognized as an internal or external command,
      operable program or batch file.
      Press any key to continue . . .

      I then understood him to say put the find_java.exe statement into the testme.bat file, which I changed to...

      @echo off
      rem for /f "delims=" %%a in ('"%~dps0\find_java.exe" -s') do echo "%%a"
      find_java.exe -s
      pause

      ...and ran it again. 

      It produced the same results. What else should I try?

      Thanks.

      Jerry

      Geek-9pm


        Mastermind
      • Geek After Dark
      • Thanked: 1026
        • Gekk9pm bnlog
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 10
      Re: luanch of executable from within .bat file fails
      « Reply #36 on: December 01, 2014, 01:39:07 PM »
      Jerry, I just sent you a PM.  Maybe it is possible to reproduce the error on on another Windows PC. But details are needed.

      Jerry Ford

        Topic Starter


        Rookie

        • Experience: Expert
        • OS: Windows 7
        Re: luanch of executable from within .bat file fails
        « Reply #37 on: December 01, 2014, 02:29:05 PM »
        Geek-9pm:

        Thanks.  I realize this is getting pretty deep, and yes the problem does seem to be limited in scope, though as has been pointed out previously, there have been a ton of similar problems reported concerning running the Android tools in various Windows environments, even if they don't match my problems precisely. (Do a Google search on android.bat for a sense of scope.)

        Be assured I do appreciate all of the suggestions/comments/replies that have been posted to this thread.

        In answer to your specific questions, the Android SDK is version 23.0.2.

        Systeminfo output...

        D:\dev\android\sdk\tools\lib>systeminfo

        Host Name:                 JERRY-PC
        OS Name:                   Microsoft Windows 7 Ultimate
        OS Version:                6.1.7601 Service Pack 1 Build 7601
        OS Manufacturer:           Microsoft Corporation
        OS Configuration:          Standalone Workstation
        OS Build Type:             Multiprocessor Free
        Registered Owner:          Jerry
        Registered Organization:
        Product ID:                00426-293-0140844-85100
        Original Install Date:     7/30/2011, 12:20:25 PM
        System Boot Time:          12/1/2014, 9:36:50 AM
        System Manufacturer:       MSI
        System Model:              MS-7599
        System Type:               x64-based PC
        Processor(s):              1 Processor(s) Installed.
                                   [01]: AMD64 Family 16 Model 4 Stepping 3 AuthenticAMD ~3300 Mhz
        BIOS Version:              American Megatrends Inc. V17.8, 1/10/2011
        Windows Directory:         C:\Windows
        System Directory:          C:\Windows\system32
        Boot Device:               \Device\HarddiskVolume3
        System Locale:             en-us;English (United States)
        Input Locale:              en-us;English (United States)
        Time Zone:                 (UTC-08:00) Pacific Time (US & Canada)
        Total Physical Memory:     16,383 MB
        Available Physical Memory: 13,050 MB
        Virtual Memory: Max Size:  32,765 MB
        Virtual Memory: Available: 28,963 MB
        Virtual Memory: In Use:    3,802 MB
        Page File Location(s):     C:\pagefile.sys
        Domain:                    WORKGROUP
        Logon Server:              \\JERRY-PC

        Output from set command...

        D:\dev\android\sdk\tools\lib>set
        ALLUSERSPROFILE=C:\ProgramData
        ANDROID_HOME=d:\dev\android
        ANDROID_SDK_HOME=d:\dev\android\sdk
        ANDROID_SWT=d:\dev\android\sdk\tools\lib\x86_64
        APPDATA=C:\Users\Jerry\AppData\Roaming
        asl.log=Destination=file
        CATALINA_HOME="E:\Program Files\apache-tomcat-6.0.29"
        CINT=d:\dev\cint\cint-5.16.19
        CommonProgramFiles=C:\Program Files\Common Files
        CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
        CommonProgramW6432=C:\Program Files\Common Files
        COMPUTERNAME=JERRY-PC
        ComSpec=C:\Windows\system32\cmd.exe;c:\mingw\bin;c:\mingw\msys\1.0\bin
        DEV_RESOURCES=E:\dev\resources
        FP_NO_HOST_CHECK=NO
        HOMEDRIVE=C:
        HOMEPATH=\Users\Jerry
        JAVA_HOME=C:\Program Files\Java\jdk1.8.0_11
        LOCALAPPDATA=C:\Users\Jerry\AppData\Local
        LOGONSERVER=\\JERRY-PC
        NANT_HOME=E:\dev\nant-0.86-beta1
        NUMBER_OF_PROCESSORS=2
        OS=Windows_NT
        Path=C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Common Files\Microsoft Shared\Microsoft Online Services;C:\Program Files (x86)\Common Files\
        Microsoft Shared\Microsoft Online Services;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\W
        bem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.8.0_11\bin;"C:\Program Files (x86)\PuTTY\";"c:\Program Files (x86)\Vim\Vim7
        3";E:\dev\nant-0.86-beta1;c:\MinGW\bin;c:\minGW\msys\1.0\bin;c:\cygwin\bin;d:\dev\cint\cint-5.16.19;d:\dev\resources\tools;d:\dev\android\sdk\tools;d:
        \dev\android\sdk
        PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
        PROCESSOR_ARCHITECTURE=AMD64
        PROCESSOR_IDENTIFIER=AMD64 Family 16 Model 4 Stepping 3, AuthenticAMD
        PROCESSOR_LEVEL=16
        PROCESSOR_REVISION=0403
        ProgramData=C:\ProgramData
        ProgramFiles=C:\Program Files
        ProgramFiles(x86)=C:\Program Files (x86)
        ProgramW6432=C:\Program Files
        PROMPT=$P$G
        PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
        PUBLIC=C:\Users\Public
        PUTTY_HOME="C:\Program Files (x86)\PuTTY\"
        SystemDrive=C:
        SystemRoot=C:\Windows
        TEMP=C:\Users\Jerry\NEWAPP~1\Local\Temp
        TMP=C:\Users\Jerry\NEWAPP~1\Local\Temp
        TOOLS=d:\dev\resources\tools
        USERDOMAIN=Jerry-PC
        USERNAME=Jerry
        USERPROFILE=C:\Users\Jerry
        VBOX_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\
        VIM="c:\Program Files (x86)\Vim\Vim73"
        windir=C:\Windows

        Jerry

        foxidrive



          Specialist
        • Thanked: 268
        • Experience: Experienced
        • OS: Windows 8
        Re: luanch of executable from within .bat file fails
        « Reply #38 on: December 01, 2014, 03:45:48 PM »
        I then understood him to say put the find_java.exe statement into the testme.bat file, which I changed to...

        @echo off
        rem for /f "delims=" %%a in ('"%~dps0\find_java.exe" -s') do echo "%%a"
        find_java.exe -s
        pause

        ...and ran it again. 

        It produced the same results.

         There are only two possible reasons why it fails 

        EDIT: See my next post

        1) find_java.exe is not in the same directory
        2) you are elevating the batch file to admin when you launch it


        Test this in the same folder:

        Code: [Select]
        @echo off
        echo "%cd%"
        dir f* /b
        find_java.exe -s
        pause
        « Last Edit: December 01, 2014, 04:19:27 PM by foxidrive »

        foxidrive



          Specialist
        • Thanked: 268
        • Experience: Experienced
        • OS: Windows 8
        Re: luanch of executable from within .bat file fails
        « Reply #39 on: December 01, 2014, 03:52:09 PM »
        ComSpec=C:\Windows\system32\cmd.exe;c:\mingw\bin;c:\mingw\msys\1.0\bin

        How did this happen?

        Comspec only accepts one target, which should be C:\Windows\system32\cmd.exe

        Comspec is used to launch Batch files and command lines.
        « Last Edit: December 01, 2014, 04:20:45 PM by foxidrive »

        Geek-9pm


          Mastermind
        • Geek After Dark
        • Thanked: 1026
          • Gekk9pm bnlog
        • Certifications: List
        • Computer: Specs
        • Experience: Expert
        • OS: Windows 10
        Re: luanch of executable from within .bat file fails
        « Reply #40 on: December 01, 2014, 04:09:04 PM »
        Thanks Jerry.
        This is one of many links about find_java.exe where they don'  know the answer.
        http://www.freefixer.com/library/file/find_java.exe-139508/
        To be explicit, they can not find the vendor or version. They gave two hash.
        Quote
        Hashes [?]
        MD5   77ab253165158f703dec3edb31b984db
        SHA256   8e82f0875a0f394f970e07efbcc689e49c102a4 6aed4cc78fe526cd0d53
        If anybody needs to know more about MD5, look here:
        Quote
        The MD5 message-digest algorithm is a widely used cryptographic hash function producing a 128-bit (16-byte) hash value, typically expressed in text format as a 32 digit hexadecimal number. MD5 has been utilized in a wide variety of cryptographic applications, and is also commonly used to verify data integrity.
        MD5 - Wikipedia, the free encyclopedia
        http://en.wikipedia.org/wiki/MD5
        Wikipedia
        So MD5 can be used to compare a file in one location with the the same file in another location to see if it has been corrupted, or revised. This could be just part in a process of verification of the relevant composts of the SDK.
        Perhaps others can publish hash values for their copies to find_jave.exe to see if there was an undocumented revision.

        Thee are free windows versions of ND5.
        http://www.winmd5.com/

        Jerry Ford

          Topic Starter


          Rookie

          • Experience: Expert
          • OS: Windows 7
          Re: luanch of executable from within .bat file fails
          « Reply #41 on: December 01, 2014, 04:24:14 PM »
          foxidrive:

          > How did this happen?

          >  Comspec only accepts one target, which should be C:\Windows\system32\cmd.exe

          Thank you so much!!! Problem appears to be solved!!! Android tools appear to be working!!!

          The mingw entries on the CommSpec variable seem to be preventing the android .bat/.exe files from being executed by CMD.

          Mingw is a GNU package that (among other things) adds C++ capability to Eclipse.  Whether I did it or an installer did it I do not know, but I do have mingw installed into my installation of Eclipse and the CommSpec environment variable it is set to the value you flagged.

          I have now edited the CommSpec environment variable as follows...

          ComSpec=C:\Windows\system32\cmd.exe

          ...and the Android files are now working correctly.

          A big Thank You to all who have contributed to this thread.

          :)

          Jerry.


          Geek-9pm


            Mastermind
          • Geek After Dark
          • Thanked: 1026
            • Gekk9pm bnlog
          • Certifications: List
          • Computer: Specs
          • Experience: Expert
          • OS: Windows 10
          Re: luanch of executable from within .bat file fails
          « Reply #42 on: December 01, 2014, 05:15:04 PM »
          So this thread is now solved!  ;D
          The CommSpec variable was wrongly set by another installer.


          Squashman



            Specialist
          • Thanked: 134
          • Experience: Experienced
          • OS: Other
          Re: luanch of executable from within .bat file fails
          « Reply #43 on: December 02, 2014, 07:40:15 PM »
          Hmmm. I am pretty sure I have installed that in the past and do not recall it ever screwing up the comspec variable.

          Geek-9pm


            Mastermind
          • Geek After Dark
          • Thanked: 1026
            • Gekk9pm bnlog
          • Certifications: List
          • Computer: Specs
          • Experience: Expert
          • OS: Windows 10
          Re: luanch of executable from within .bat file fails
          « Reply #44 on: December 02, 2014, 07:44:02 PM »
          Hmmm. I am pretty sure I have installed that in the past and do not recall it ever screwing up the comspec variable.
          You are right. The right SDK does not mess with it.
          The OP had installed some other thing that ruined Com spec.
          It happens.