Link to home
Start Free TrialLog in
Avatar of unisupport
unisupport

asked on

Use IEXPRESS.EXE to package a batch file along with two exe files the batch file can call depending on user input

I have created a batch file that can run off of my thumb drive that will call different exe's  and a .txt file using the choice command and the users input in the DOS screen. Everything works fine before I use IEXPRESS.EXE to convert the seperate files into an exe. The exe runs and the dos screen pops up with the first choice but the path to the exe it calls can not be resolved. Is IEXPRESS.EXE not capable of handling this? Do I need to adjust my paths in the bat file? Is there a different free solution to accomplish this? The code has a software key in it I can not post but will happily answer or post an other portions of the code. This is my first extensive batch file and first use of IEXPRESS.EXE, thanks for your help.
Avatar of robsantos
robsantos

I think I know what you're saying...

I dabbled with IEXPRESS once and I think I had a similar experience... which is why I was happy to find "ZIP 2 Secure EXE" (free)

http://www.chilkatsoft.com/chilkatSfx.asp

Zip the files needed (if you need something for this, I'd suggest 7-Zip - http://www.7-zip.org/)
Point "ZIP 2 Secure EXE" to that zip
Then tell "ZIP 2 Secure EXE" which file you want it to launch.

pretty easy
Avatar of unisupport

ASKER

Thank-you for the advice I will try you recommendation as soon as I am back in the office.
If it is possible for you to post your batch file without revealing any secrets, then I would like to try and see if I can figure out where the problem lies.

You mention "the choice command".  DOS in Win9x had choice.com in the C:\Windows\Command folder, but Windows XP doesn't have such an internal or external command.  You have to use the SET command to emulate the choice command.  Is that what you have done?

https://www.experts-exchange.com/questions/22669688/Batch-file-menu-in-XP-without-the-choice-command.html
Ok all the files are zipped up and I found the application I think you are referring to online for zip to secure. This appears to be a trial ware for vb programmers? Here is the weird message I get during the install.
Thank you for downloading Chilkat Zip

30-Day Trial: This product is unlocked by calling the ChilkatZip2.UnlockComponent method from within your application.  During the 30-day trial, which begins now, any string parameter passed to UnlockComponent will unlock the component.  A permanent unlock code is provided after purchase, and it should replace the temporary parameter.  For example (in VB6):

isUnlocked = zipObject.UnlockComponent("AnythingWorksFor30DayTrial")

If i'm missing some here please direct me to the correct program, thanks:)
BillDL I did a work around to the set/choice problem by downloading the choice command and including it in the root where the bat file is run from. The batch file is working fine on the different operating systems. The batch file calls two executable programs during its run and by converting the two exe, one text file, the choice command into an exe I can distribute it to our computer technicians as one file rather than seperate files. I feel robsantos is on the right track, I just got stuck at the Zip 2 Secure step.
:START
@echo off 
:: MAIN MENU***************************************************************************************
:: THE BELOW LINE GIVES THE USER 3 CHOICES (DEFINED AFTER /C:)
CHOICE /N /C:123 PICK A NUMBER (1 BACKUP, 2 CLEANUP, or 3 QUIT)%1
REM - THE NEXT THREE LINES ARE DIRECTING USER DEPENDING UPON INPUT
IF ERRORLEVEL ==3 GOTO QUITMAINTENANCE
IF ERRORLEVEL ==2 GOTO CLEANUPOPTION
IF ERRORLEVEL ==1 GOTO BACKUPOPTION
GOTO CLOSE
 
:QUITMAINTENANCE
ECHO.
ECHO YOU HAVE PRESSED THREE TO QUIT
ECHO.
GOTO CLOSE
 
:CLEANUPOPTION
ECHO.
ECHO YOU HAVE PRESSED TWO FOR CLEANUP
ECHO.
GOTO CLEANUP
 
:BACKUPOPTION
ECHO.
ECHO YOU HAVE PRESSED ONE FOR BACKUP
ECHO.
GOTO DRIVESELECT
:: END MAIN MENU***********************************************************************************
:: CLEANUP ROUTINE*********************************************************************************
:CLEANUP
 
:: THE BELOW LINE GIVES THE USER 3 CHOICES (DEFINED AFTER /C:)
CHOICE /N /C:123 PICK A NUMBER (1 program1name, 2 program2name, or 3 QUIT)%1
REM - THE NEXT THREE LINES ARE DIRECTING USER DEPENDING UPON INPUT
IF ERRORLEVEL ==3 GOTO QUITTUNEUPMENU
IF ERRORLEVEL ==2 GOTO program2nameOPTION
IF ERRORLEVEL ==1 GOTO program1nameOPTION
GOTO CLOSE
 
:QUITTUNEUPMENU
ECHO.
ECHO YOU HAVE PRESSED THREE TO QUIT
ECHO.
GOTO CLOSE
 
:program1nameOPTION
ECHO.
ECHO YOU HAVE PRESSED TWO TO RUN program
ECHO.
%0\..\program2name.exe
 
%0\..\readme.TXT
 
GOTO CLOSE
 
:Program1nameOPTION
ECHO.
ECHO Loading program
ECHO.
%0\..\Program2name.exe
 
GOTO CLOSE
:: END CLEANUP ROUTINE*****************************************************************************
 
:: DRIVE SELECTION*********************************************************************************
:DRIVESELECT
 
CHOICE /N /C:12 PICK A NUMBER (1 SPECIFY DRIVE LETTER, 2 DEFAULT NETWORK PATH)%1
:: THE NEXT TWO LINES ARE DIRECTING USER DEPENDING UPON INPUT
IF ERRORLEVEL ==2 GOTO PATHTWO
IF ERRORLEVEL ==1 GOTO PATHONE
GOTO END
 
:: ALLOWS YOU TO CHOOSE A DRIVE LETTER~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:PATHONE
ECHO.
ECHO YOU HAVE PRESSED 1 TO CHOOSE A DRIVE LETTER
ECHO.
echo "Please enter the drive letter where you wish to save your backups" 
 
for /f "tokens=2-4 delims=./-" %%f in ("%date%") do (
  set today_=%%h%%f%%g
)
 
:: variables
set /p DriveLetter=
set drive=%DriveLetter%:\%today_%%username%
set backupcmd=xcopy /s /c /d /e /h /i /r /y
:: END variables
 
:: CHECK IF SELECTED DRIVE EXISTS
IF NOT EXIST %DriveLetter%:\ (GOTO nodrive)
 
::DEFAULT NETWORK PATH~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:PATHTWO
ECHO.
ECHO YOU HAVE PRESSED 2 FOR DEFAULT NETWORK PATH
ECHO.
echo "The default path is \\server\data\backup\%date%%username%"
echo "Note: You must be a member of the same workgroup as the server" 
 
for /f "tokens=2-4 delims=./-" %%f in ("%date%") do (
  set today_=%%h%%f%%g
)
 
:: variables
set drive=\\SERVER\data\backup\%today_%%username%
set backupcmd=xcopy /s /c /d /e /h /i /r /y
:: END variables
 
:: CHECK IF SELECTED DRIVE EXISTS
IF NOT EXIST %DriveLetter%:\ (GOTO nodrive)
 
GOTO CLOSE 
 
:: END DRIVE SELECTION*****************************************************************************
 
:: BACKUP ROUTINE**********************************************************************************
:BACKUP
 
echo ### Backing up My Documents...
%backupcmd% "%USERPROFILE%\My Documents" "%drive%\My Documents"
 
echo ### Backing up Favorites...
%backupcmd% "%USERPROFILE%\Favorites" "%drive%\Favorites"
 
echo ### Backing up Desktop...
%backupcmd% "%USERPROFILE%\Desktop" "%drive%\Desktop"
 
echo ### Backing up Cookies...
%backupcmd% "%USERPROFILE%\Cookies" "%drive%\Cookies"
 
echo ### Backing up email and address book (Outlook Express)...
%backupcmd% "%USERPROFILE%\Application Data\Microsoft\Address Book" "%drive%\OE Address Book"
%backupcmd% "%USERPROFILE%\Local Settings\Application Data\Identities" "%drive%\Outlook Express"
 
echo ### Backing up email and contacts (MS Outlook)...
%backupcmd% "%USERPROFILE%\Local Settings\Application Data\Microsoft\Outlook" "%drive%\Outlook"
 
echo ### Backing up custom dictionary (MS Outlook)...
xcopy "%USERPROFILE%\Application data\Microsoft\Proof" "%drive%\OulookDictionary\"
 
echo ### Backing up custom signatures (MS Outlook)...
xcopy "%USERPROFILE%\Application data\Microsoft\Signatures" "%drive%\OulookSignatures\"
 
 
echo ### Backing up the Registry...
if not exist "%drive%\Registry" mkdir "%drive%\Registry"
if exist "%drive%\Registry\regbackup.reg" del "%drive%\Registry\regbackup.reg"
regedit /e "%drive%\Registry\regbackup.reg"
GOTO END
:: END BACKUP ROUTINE******************************************************************************
 
:: NODRIVE ROUTINE*********************************************************************************
:nodrive
ECHO.  
ECHO  ********************************************************************
ECHO  *                                                                  *
ECHO  *            Selected drive or Network Path not detected           *
ECHO  *            -------------------------------------------           *
ECHO  *                                                                  *
ECHO  *   Please verify the following:                                   *
ECHO  *           1) Drive is appearing in your My Computer Drive List   *
ECHO  *           2) Drive appears in Windows as letter you entered      *
ECHO  *                                                                  *
ECHO  ********************************************************************
ECHO.
 
CHOICE /N /C:12 PICK A NUMBER (1 Retry, 2 Quit)%1
:: THE NEXT TWO LINES ARE DIRECTING USER DEPENDING UPON INPUT
IF ERRORLEVEL ==2 GOTO TWO
IF ERRORLEVEL ==1 GOTO ONE
GOTO END
 
:ONE
ECHO.
ECHO YOU HAVE PRESSED 1 TO RETRY
ECHO.
GOTO DRIVESELECT
 
:TWO
ECHO.
ECHO YOU HAVE PRESSED 2 Good Bye!
ECHO.
GOTO CLOSE 
:: END NODRIVE ROUTINE*****************************************************************************
 
:: ENDING THE BACKUP ROUTINE
:END
echo Backup Complete!
@pause
 
:: END ROUTINE FOR THOSE OTHER THAN THE BACKUP
:CLOSE
echo Good Bye!
@pause

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of robsantos
robsantos

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Rob, Thank-you kindly for the solution and link, this was spot on. Much appreciated.
glad it worked for you unisupport!