DOS errors on a simple batch file packaged with Iexpress...
#1
Posted 18 February 2008 - 11:53 AM
I created a simple batch file to run some commands and copy files, and it works great. The folder
contains all the files and no matter where I put the folder, the batch file works.
So I thought it would be even better if it was packaged as an EXE, I used Iexpress on WindowsXP. Iexpress unpackages everything to a temp folder, then runs my setup.bat file. The first few commands that worked before it was packaged were Title, Color, an IF statement and a SET statement. When you double click the package the files expand (echo is on and there are lots of pauses). If, color and title are bad command or file name and the set error is out of environment space. I would think it has to be DOS related since the batch file can no longer run the If command, it doesnt' know where to find that internal command. Any ideas?
Thanks a bunch!
#2
Posted 18 February 2008 - 01:37 PM
#3
Posted 18 February 2008 - 03:07 PM
This is the start of my setup.bat file
rem @echo off
cmd /C title My Ghostcast setup
color 71
pause
if not exist "C:\Documents and Settings\All Users\Application Data\Symantec\Ghost\Template" mkdir "C:\Documents and Settings\All Users\Application Data\Symantec\Ghost\Template"
set ghostall=C:\Documents and Settings\All Users\Application Data\Symantec\Ghost\Template
ECHO.
ECHO . Expanding files
echo %ghostall%
echo This should have echoed ghostall
pause
7za e -o"%ghostall%" -y .\DOSNIC.7z
if not exist "C:\Program Files\Symantec\Ghost" mkdir "C:\Program Files\Symantec\Ghost"
ECHO.
ECHO . Setting up and sharing the Ghost directory if it's not already
ECHO.
pause
net share Ghost="C:\Program Files\Symantec\Ghost"
ECHO . Copying files
ECHO.
set ghostprog=C:\Program Files\Symantec\Ghost
echo %ghostprog%
echo This should have echoed ghostprog
pause
xcopy .\gdisk.exe "%ghostprog%"
xcopy .\gdisk32.exe "%ghostprog%"
xcopy .\"ghost boot wizard.exe" "%ghostprog%"
xcopy .\"Ghost Boot Wizard.lnk" "%ALLUSERSPROFILE%\desktop" /y /q /c
xcopy .\ghost32.exe "%ghostprog%"
xcopy .\ghost.exe "%ghostprog%"
I have no issues when I run setup.bat. It's only after it's packages with Iexpress.
I start by creating a new package in Iexpress and including all of the necesary files in one folder. On the Install Program to Launch screen I select setup.bat. Everything packages fine. When I run the EXE it expands everything but when it hits the Color command I get a bad command or file name. The same is true of the first IF statement...and so on..
Thank you.
#4
Posted 18 February 2008 - 03:59 PM
Why would I get a bad command or file name error when it's packaged as an EXE. Obviously it can't find color, whether it's an internal or external command. My question is why?
#5
Posted 18 February 2008 - 05:06 PM
#6
Posted 18 February 2008 - 05:22 PM
Try this, create test.bat with this code:
@echo off
title Test
color 71
pause
Run it and you get a Dos box titled Test, with a grey background and blue lettering.
Now open Iexpress, create a new directive file, purpose=extract files and run installation program, set the install program to Test.bat you just created and watch what happens. You'll get 2 bad command or file name errors then it pauses...it's a dos environment issue of some sort that's driving me nuts!
If I use Winzip self extractor to create the EXE it works great. So I'm at a loss as to why Iexpress is failing.
#7
Posted 18 February 2008 - 10:21 PM
@echo off
title Test
color 71
set
pause
The output of set is from command.com, not cmd.exe! And a lot of the variables are truncated to 8.3 format.
Getting somewhere...
#8
Posted 19 February 2008 - 03:58 AM
meister, on Feb 18 2008, 09:07 PM, said:
Of course IExpress will run a cmd file!
meister, on Feb 18 2008, 11:22 PM, said:
That wasn't a fix for all your problems, I'm telling you that you don't need the cmd /c in order to run title. All you need is what you've used in the example you've provided above.
Attached is a zipped archive containing a CMD file and its associated SED file, place them both in the root of your C: drive, run it through your IExpress wizard, create the EXE and run it!
Also if you want to edit the SED file change the two instances using CMD file extensions to BAT and rename your CMD script to BAT, you'll probably find it doesn't work when run!
Attached File(s)
-
MyTest.zip (677bytes)
Number of downloads: 9
#9
Posted 19 February 2008 - 09:49 AM
When i add a cmd file to "Packaged Files" then Next to "Install Program to Launch" I don't see any cmd files listed.
What I just tried though, thanks to your guidance, I took my non working SED and edited it, changing AppLaunched= to the cmd file instead of tha bat (i just renamed my bat to cmd) and in one quick test it worked. Is that how you did it?
#10
Posted 19 February 2008 - 10:33 AM
My usual method, when I used to use this tool, was to modify an existing SED file however.
#11
Posted 19 February 2008 - 10:52 AM
Oh well, now I know. THANK YOU so much! It was holding me back on a few things.
Will
- ← VBScript - Writing Func/Sub that can take 0 or 1 args?
- Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
- VB install app →



Help
Back to top








