QUOTE (soporific @ May 30 2007, 04:24 PM)

QUOTE (plonkeroo @ May 30 2007, 10:59 PM)

SET PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\;C:\WINDOWS\SYSTEM;C:\PROGRA~1\COMMON~1\ROXIOS~1\DLLSHA~1;C:\PERL\SITE\BIN;C:\PERL\BIN
what is it with people and their humungous PATH statements in their AUTOEXEC.BAT files ? No offense Plonk me mate ... OK this advice is the definite way to temporarily solve most AP problems where it just exits out ungracefully.
If the following is true:
1) When you use AP, especially the 1.96 upgrade, it doesn't reach the end, or it doesn't even start, or you see "Out of environment space" messages.
2) Inside your AUTOEXEC.BAT file you have a "SET PATH= ...." or "SET CLASSPATH= ..." that is quite a long string of text.
You can by-pass this problem by doing the following:
1) go to START - RUN and in the Run dialog box type SYSEDIT and hit return (enter)
-- this brings up all your configuration files into like notepad type windows
2) choose the AUTOEXEC.BAT window, and any line that starts with "SET PATH= ...." or "SET CLASSPATH= ..." put the word "REM" at the start of the line.
eg
if your AUTOEXEC.BAT looks like the following:
QUOTE
SET BLASTER=A260 I9 D3 H3 T4
SET PATH=%PATH%;c:\progra~1\common~1\gtk\2.0\bin
SET Path=%Path%;"C:\Program Files\Executive Software\DiskeeperLite\"
SET OGRE_HOME=c:\OgreSDK
SET CLASSPATH=.;C:\PROGRA~1\ARTOFI~1\LIB\SOUND.JAR;C:\PROGRA~1\ARTOFI~1\LIB;C:\PROGRA~1\ARTOFI~1\LIB\JMF.JAR
you would then add REM words like this:
QUOTE
REM SET BLASTER=A260 I9 D3 H3 T4
REM SET PATH=%PATH%;c:\progra~1\common~1\gtk\2.0\bin
REM SET Path=%Path%;"C:\Program Files\Executive Software\DiskeeperLite\"
REM SET OGRE_HOME=c:\OgreSDK
REM SET CLASSPATH=.;C:\PROGRA~1\ARTOFI~1\LIB\SOUND.JAR;C:\PROGRA~1\ARTOFI~1\LIB;C:\PROGRA~1\ARTOFI~1\LIB\JMF.JAR
you don't have to REM out all the lines, just do the really big one that is causing all the fuss !! After you use AP, just return your AUTOEXEC.BAT file to the way it was by taking out the REMs. What is the effect of adding REMs? What will happen? You were wondering weren't you... it just means that the particular program that 'installed' that PATH statement (or whichever variable it is) won't be able to run normally while that REM word is there. SO this means that if a anti-virus program has added a line then maybe keep that unREMmed. Again, the easiest thing is just to REM out one line --- which line? The longest line! That's right, you there at the back.
I am writing a function that will do this as a menu option and or if you fail the ES test but until then, everybody in this situation, this is what you do!


Soporific. Last night I spent some time working with AP 1.96.52 because this version contains the "debugging" code you inserted for Nathanson1947, I think it was, saving me the trouble of having to insert the code myself.
In running my tests I made use of "Strings.com" as well as the "Set" command which I used to list the environment variables that were defined at the time I invoked the Set command, the output of which was redirected to a text file.
The results of the limited testing I did were very interesting and showed that the "Start.exe" command that you use to launch some of your batch files does not function in the way one would expect. The use of Start.exe is (was?) in fact one of the reasons that AP unexpectedly runs out of ES.
Here's an extract of some of the code from AP 1.95.55 AutoPatch.bat =>
CODE
:RESTART8
:: pause a bit
"%LOC8%\bin\WAIT" 1.2
:: clear environment values starting the next file to ensure variables don't have a 'no memory' excuse for not setting.
FOR %%! in (ZZ ZY ZX) DO SET MD%%!=
FOR %%! in (00 01 02 03 04 05 06 07) DO SET MD%%!=
FOR %%! in (08 09 10 11 12 13 14 15 16) DO SET MD%%!=
FOR %%! in (0201 0202 0203 0204 0205 0206 0207 0208 0209) DO SET OP%%!=
FOR %%! in (0601 0602 0603 0604) DO SET OP%%!=
FOR %%! in (0901 0902 0903 0904 0905 0906) DO SET OP%%!=
FOR %%! in (1201 1202 1203 1204 1205) DO SET OP%%!=
FOR %%! in (1401 1402 1403 1404 1405 1406 1407 1408 1409 1410) DO SET OP%%!=
FOR %%! in (1411) DO SET OP%%!=
FOR %%! in (1501 1502 1503 1504 1505 1506 1507) DO SET OP%%!=
FOR %%! in (WillBe WontBe NoSave YeSave CULOR MM) DO SET %%!=
FOR %%! in (MyDayN MyDay MyMon MyYear NSec NMin NHour) DO SET %%!=
:: start the current module
START %COMSPEC% /E:2048 /K "%LOC8%\code\Run-Mod.bat" Fullup %WINDRIVE% %WINDODIR% "%LOC8%"
Because Start.exe does make use of the environment space available to AutoPatch.bat, nor the variables defined within AutoPatch.bat, nor those defined within the Batch files that launched AutoPatch.bat, clearing the environment variables using the FOR loops shown above does not make additional ES space available to Run-Mod.bat prior to it being launched. In other words, had you left your code the way you had it in versions of AP prior to 1.96.55, you would have achieved exactly the same result as you do with AP 1.96.55. So AP 1.96.55's code would be just as effective written this way =>
CODE
:RESTART8
:: pause a bit
"%LOC8%\bin\WAIT" 1.2
:: start the current module
START %COMSPEC% /E:2048 /K "%LOC8%\code\Run-Mod.bat" Fullup %WINDRIVE% %WINDODIR% "%LOC8%"
:: clear environment values starting the next file to ensure variables don't have a 'no memory' excuse for not setting.
FOR %%! in (ZZ ZY ZX) DO SET MD%%!=
FOR %%! in (00 01 02 03 04 05 06 07) DO SET MD%%!=
FOR %%! in (08 09 10 11 12 13 14 15 16) DO SET MD%%!=
FOR %%! in (0201 0202 0203 0204 0205 0206 0207 0208 0209) DO SET OP%%!=
FOR %%! in (0601 0602 0603 0604) DO SET OP%%!=
FOR %%! in (0901 0902 0903 0904 0905 0906) DO SET OP%%!=
FOR %%! in (1201 1202 1203 1204 1205) DO SET OP%%!=
FOR %%! in (1401 1402 1403 1404 1405 1406 1407 1408 1409 1410) DO SET OP%%!=
FOR %%! in (1411) DO SET OP%%!=
FOR %%! in (1501 1502 1503 1504 1505 1506 1507) DO SET OP%%!=
FOR %%! in (WillBe WontBe NoSave YeSave CULOR MM) DO SET %%!=
FOR %%! in (MyDayN MyDay MyMon MyYear NSec NMin NHour) DO SET %%!=
Before I get into any explanations, I think it best to describe the tests I set up.
First test
I modified the code in AutoPatch.bat as follows:
CODE
:: start the current module
c:\Program Files\AutoPatch98\Bin\Strings envsize
c:\Program Files\AutoPatch98\Bin\Strings envfree
set > "c:\Program Files\AutoPatch98\Logs\envpatch.txt"
pause
START "%LOC8%\code\Run-Mod.bat" Fullup %WINDRIVE% %WINDODIR% "%LOC8%"
%WINDODIR% "%LOC8%"
pause
Goto End
In Run-Mod.bat, after the CLS command I inserted the following code:
CODE
c:\Program Files\AutoPatch98\Bin\Strings envsize
c:\Program Files\AutoPatch98\Bin\Strings envfree
set > "c:\Program Files\AutoPatch98\Logs\envmod.txt"
pause
2nd Test
I modified the code in AutoPatch.bat as follows:
CODE
:: start the current module
c:\Program Files\AutoPatch98\Bin\Strings envsize
c:\Program Files\AutoPatch98\Bin\Strings envfree
set > "c:\Program Files\AutoPatch98\Logs\envpatch.txt"
pause
CALL "%LOC8%\code\Run-Mod.bat" Fullup %WINDRIVE% %WINDODIR% "%LOC8%"
pause
Goto End
In Run-Mod.bat, after the CLS command I inserted the following code:
CODE
c:\Program Files\AutoPatch98\Bin\Strings envsize
c:\Program Files\AutoPatch98\Bin\Strings envfree
set > "c:\Program Files\AutoPatch98\Logs\envmod.txt"
pause
Results of 1st Test
Run-Mod.bat gave two "out of environment space" warnings
Envsize in AutoPatch.bat was 4112 bytes
Envfree in AutoPatch.bat was 2330 bytes
Envpatch.txt listed all the environment variables that had been defined by AP prior to Run-Mod.bat being invoked
Envsize in Run-Mod.bat was 1456 bytes
Envfree in Run-Mod.bat was 1008 bytes
Envmod.txt did not list any of the environment variables that had been defined by AP prior to Run-Mod being invoked.
This was a very suprising result to me because I had expected Envsize to be the same in both AutoPatch.bat and Run-Mod.bat. I had also expected the contents of Envmod.txt to be exactly the same as those in Envpatch.txt which they were not.
Results of 2nd Test
Run-Mod.bat did not give any "out of environment space" warnings
Envsize in AutoPatch.bat was 4112 bytes
Envfree in AutoPatch.bat was 2330 bytes
Envpatch.txt listed all the environment variables that had been defined by AP prior to Run-Mod.bat being invoked
Envsize in Run-Mod.bat was 4112 bytes
Envfree in Run-Mod.bat was 2330 bytes
Envmod.txt listed exactly the same set of environment variables as those listed Envpatch.txt
This result was in line with what I had expected. It was also the result I had expected from the 1st test.
Also you can see that using CALL instead of START to launch Run-Mod.bat resolved the "out of environment space" warnings previously output by Run-Mod.bat in the 1st test.
Ok, so what's going on here?
Before I can answer that I need to provide another piece of information.
In the first test the values of Envsize and Envfree in Run-Mod.bat as well as the contents of Envmod.txt were strangely familiar to me. After some time puzzling over the familiarity, I realised that the values of Envsize and Envfree were exactly the same values I would get if I used Strings.com to check my environment space immediately after booting up SE. In addition, the environment variables listed in Envmod.txt were exactly same as those that would be listed if I used the Set command to list the environment variables defined immediately after booting up SE.
Taking cognisance of everthing I described above, here's what I conclude from my tests =>
- Start.exe actually spawns Run-mod.bat off as a separate process that is totally independent of AutoPatch.bat
- Because Run-mod.bat is spawned off as a separate process, SE has to allocate it an initial amount of ES space. By default the amount of space allocated is exactly the same as that allocated at the time SE boots up.
- Because Run-mod.bat is spawned off as a separate process, the environment variables defined in AP are not available to Run-mod.bat as global variables. The only environment variables available to Run-Mod.bat are those defined at the time SE boots up, and those passed as parameters to Run-Mod.bat.
- A command such as
CODE
START %COMSPEC% /E:2048 /K "%LOC8%\code\Run-Mod.bat" Fullup %WINDRIVE%
can only be used in situations where the batch file being launched does not need to make use of more than 8 (or is it 9?) environment variables defined by AP prior to launching the batch file. The values of the environment variables can of course be passed as parameters to the batch file as happens in this particular command, but then no more than 8 (9?) values can be passed in this way
- If on being launched the batch file needs to make use of more than 8 (9?) environment variables, then the CALL command must be used instead of the START command. If the CALL command is used, then the amount of free environment space available to the batch file being launched will be the same or similar to that available in the batch file that initiated the launch