Once BAT is compiled into an EXE, I can't get embedded EXE's to run properly

2

I have created a batch file that lets me change the static IP Address or enable DHCP of my network adapters. It works wonderfully. I execute several EXE files written by Horst Schaeffer. They are Wbox, Wbusy, and winput (found here: https://www.horstmuc.de/wcon.htm). These programs are located in the same folder as my BAT. I also use another BAT written by Artur Zgadzaj to give my window admin privileges (https://superuser.com/a/921887).

(BTW, I was unable to get any of the other options on the linked page to work besides Zgadzaj's. If you have a simpler solution, please let me know.)

ISSUE:

When I try to make the BAT and EXE through iexpress, it runs up until the first popup screen and displays the pop-up. But once a selection is chosen, the program closes instead of continuing to run.

This code is basically what I am doing but much more simplified and lots of added text for your clarification:

@ECHO off

:TOF

:: ECHO This is a test file.
:: ECHO.
:: ECHO First, we will give this cmd window admin privileges.
:: PING localhost -n 4 >NUL

:Admin_Priv
    :: Run Batch_Admin.bat to auto-promt admin privilages
    net session >nul 2>nul&if errorlevel 1  Batch_Admin "%~0" %*

:: ECHO.
:: ECHO We will now check admin privileges.
:: PING localhost -n 4 >NUL

:check_Permissions2
    ECHO.
    ECHO Detecting permissions...
    net session >nul 2>&1
    if %errorLevel% == 0 (
        echo Success: Administrative permissions confirmed.
    ) else (
        echo Failure: Current permissions inadequate.
    )

:: ECHO.
:: ECHO The main part of the file will now begin...
:: PING localhost -n 4 >NUL

:Num_0
    ECHO.
    ECHO This in Number 0
    WBOX "Go To what?" "Choose" "1;2;Write Something" /BW=110
    GOTO Action_%errorlevel%
        :Action_1
        GOTO Num_1
        :Action_2
        GOTO Num_2
        :Action_3
        GOTO W_S

:Num_1
    ECHO.
    ECHO This in Number 1
    PAUSE
    WBOX "Go To what?" "Choose?" "0;2;Write Something" /BW=110
    GOTO Action_%errorlevel%
        :Action_1
        GOTO Num_0
        :Action_2
        GOTO Num_2
        :Action_3
        GOTO W_S

:Num_2
    ECHO.
    ECHO This in Number 2
    PAUSE
    WBOX "Go To what?" "Choose" "0;1;Write Something" /BW=110
    GOTO Action_%errorlevel%
        :Action_1
        GOTO Num_0
        :Action_2
        GOTO Num_1
        :Action_3
        GOTO W_S

:W_S
    ECHO.
    ECHO You can write something in the next pop-up box and have it display here.
    PAUSE

    ECHO.
    TYPE nul >temp.cmd
    winput "Type Words" "set WORD_CHOICE=$input" "write what you wish to be displayed in cmd." "(Enter text here)" > temp.cmd
    call temp.cmd
    DEL temp.cmd
    ECHO You typed:
    ECHO %WORD_CHOICE%
    ECHO.
    PAUSE

    ECHO.
    WBOX "Go To what?" "Choose?" "0;1;2" /BW=110
    GOTO Action_%errorlevel%
        :Action_1
        GOTO Num_0
        :Action_2
        GOTO Num_1
        :Action_3
        GOTO Num_2

When activating all the commented commands at the beginning, it runs right up to the pop-up and closes. I added them in this code (not my original) to see what was going on and what was causing the close.

I've tried creating this in "Advanced BAT to EXE" as well so that I could remove the Admin script and have the program auto prompt for privileges, but a very similar thing occurs.

I'm sure it has something to do with recalling the EXE programs and/or storing their temp information, but I haven't a clue on how to solve that. I'm only a novice amateur creating these things to simplify my work-flow as an artist.

Any help would be much appreciated. Thanks!

Breckt

Posted 2019-05-02T15:06:44.973

Reputation: 21

What exactly is the reason you want to make an exe off this? To hide code and make it look like an actual application? If so, I would suggest you just use a proper language to create a proper app. – Gerhard Barnard – 2019-05-03T13:06:06.697

Which program would you suggest? I have ample time to learn one, I just don't know which to begin with.

Cheers. – Breckt – 2019-11-26T16:27:17.523

No answers