Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Path statements in Autoexec.bat file

Status
Not open for further replies.
Dec 27, 2002
167
US
I have too many programs that insert Path lines in my autoexec.bat file that I cannot get all the programs to load.

I need:
1 for Netware
1 for a program run from the netware server
2 for Oracle
2 for Windows
2 for my Manuacturing software
2 for my warehouse software
2 for my Anti-Virus

Any recommendations on how to layout the Autoexec.bat file to accomodate all these Path Statements. My only other option is to upgrade to win 2000 (Which would be better anyway) but I have one application that only runs on a 16-bit platform and doesn't run on NT.

 
I assume that the problem is running out of memory to contain the full path.

You can extend the memory assigned to the environment. Have forgotten the config.sys entry to do it but will research and post back if nobody else pegs it first.

The second way is to assign a minimal path, then via batch calling the program save the original path, modify the current path to add what you need, then on exit call the batch file resetting the original path.

Because I use a lot of dos stuff I prefer the second approach.

Ed Fair
Any advice I give is my best judgement based on my interpretation of the facts you supply. Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.
 
Try this in your autoexec.bat:

Path C:,C:\Windows, whatever- some of your paths are

Then on the next line:

Path %path%,some more paths

Repeat this line as neccessary. I'm not sure if there's a limit to how many times you can append to the path.
 
Actually it is saying "too many parameters".

Here is the Autoexec.bat file.
___
PATH C:\Novell\Client32;%PATH%;C:\PROGRA~1\CA\SHARED~1\SCANEN~1;C:\PROGRA~1\CA\ETRUST~1
Set NWLANGUAGE=ENGLISH
SET path="C:\Program Files\Oracle\jre\1.1.7\bin";"%path%";
SET Path=C:\Orawin95\bin;"%Path%"
PATH C:\Novell\Client32
SET path="C:\Program Files\Oracle\jre\1.1.7\bin"
PATH=Z:\PUBLIC;C:\WINDOWS;C:\WINDOWS\COMMAND;C:\ORAWIN95\BIN;V:\VMFG;c:\DMI\WIN32\BIN
SET WIN32DMIPATH=c:\dmi\win32
set PATH=C:\VISUAL\RUNTIME;%PATH%
SET PATH=%PATH%;C:\PROGRA~1\SYBASE\SQLANY~1\WIN32
SET PATH=%PATH%;C:\Program Files\Sybase\Shared\win32
SET AVENGINE=C:\PROGRA~1\CA\SHARED~1\SCANEN~1
C:\PROGRA~1\CA\SHARED~1\SCANEN~1\EXAMINE.EXE
SET INOCULAN=C:\PROGRA~1\CA\ETRUST~1
___

I did go in a delete some of the duplicated statements
 
Not sure about the "%path%" part. Earlier versions used just the %path% to set it like in several of your lines.

I would question the flow of it however, the 4th path statement wipes out the 3 previous ones. And possibly several others affect the previous ones.

You could , for diagnostic purposes, add a pause after each line of the AE and see where the problem is coming.
You could also add a path and a pause in 2 lines between each existing line. that will show the effects of each line while pausing to let you evaluate what is going on.

Ed Fair
Any advice I give is my best judgement based on my interpretation of the facts you supply. Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.
 
Try something like this. As mentioned above, several of the existing path statements were negating previous statements. I also took out the path to the Z:\public directory. It's doubtful that there is anything there that needs a path statement.

Set NWLANGUAGE=ENGLISH
PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\Novell\Client32;C:\PROGRA~1\CA\SHARED~1\SCANEN~1;C:\PROGRA~1\CA\ETRUST~1
PATH=%path%,C:\Program Files\Oracle\jre\1.1.7\bin";C:\Orawin95\bin;
PATH=%path%,V:\VMFG;c:\DMI\WIN32\BIN;c:\dmi\win32
PATH=%path%,C:\VISUAL\RUNTIME;C:\PROGRA~1\SYBASE\SQLANY~1\WIN32
PATH=%PATH%;C:\Program Files\Sybase\Shared\win32
SET AVENGINE=C:\PROGRA~1\CA\SHARED~1\SCANEN~1
C:\PROGRA~1\CA\SHARED~1\SCANEN~1\EXAMINE.EXE
SET INOCULAN=C:\PROGRA~1\CA\ETRUST~1



There's always a better way. The fun is trying to find it!
 
Line 2 could become path=%path%;c:\novell....
The windows and windows\command are built in.

Ed Fair
Any advice I give is my best judgement based on my interpretation of the facts you supply. Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.
 
edfair had the right approach. Your problem is caused by a shortage of "environmental memory" - very common in the ancient days of MSDOS. The trick is to put a line in your config.sys file that will allocate more memory for your path statement(s).

One of these should work:

Shell=C:\command.com /e:4096 /P

or

Shell=C:\windows\command.com /e:4096 /P

In DOS, I used 334 instead of 4096, but your path statements are pretty long. You might get away with a lower multiple of 1024, but 4096 is probably not overkill.

The /P makes the change "permanent" so that typing "exit" at a command line will not take you to the lower, default environment.

I remain an amature, and my advice is not a professional recommendation. Following it is at your own risk.

Happy computing.


 
Actually , that was my response until I tried it out on 95a.
Evidently the later versions have a dynamic allocation of environmental memory.

I ended up with a 555 byte path with no problem and with no additional steps required. Looked pretty funny when I did a path and ended up with 7 full lines.

I suspect that there is an error in one of the path statements. A space. possibly. That is one reason that I suggested the path and pause. It is a dynamic way to figure out the problem. And of course, straighten out the overwrites.

Ed Fair
Any advice I give is my best judgement based on my interpretation of the facts you supply. Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.
 
I'm currently on an ME machine, so I am not able to check it out, but is there supposed to be quotes around the two %PATH% 's listed (originally)?

I thought if you use quotes, it would take it as a literal string and NOT a variable...or am I mistaken?

--MiggyD
 
While in the command prompt you can just type PATH and that should show you the path that the computer is using. Correct the sections that are wrong.
 
MiggyD,

Ran it on a testbed system under 95. Works both ways.
I had been curious also, so I had to try it.

Ed Fair
Any advice I give is my best judgement based on my interpretation of the facts you supply. Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top