Solved

autoexec.bat - nt  & dos - dual boot - env settings by os

Posted on 1997-06-17
8
363 Views
Last Modified: 2013-12-28
Have system that can boot dos (on c:) and nt (d:).
NT reads the autoexec.bat on c: at boot.  How can
I modify the environmental assignments base on OS?
For example -- if dos is booting path=c:\bin, if NT
boots path=d:\bin ... and so on.   How about config.sys
dynamic mods too?

Already tried executing set>aFile in autoexec.bat to
inspect current env - doesn't run on NT boot (or doesn't
leave a file).
Already tried putting "NT" version of autoexec.bat on
d:\ - doesn't read it.
No registry mods please - unless necessary.  Thanks
0
Comment
Question by:hank1
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 12

Expert Comment

by:j2
ID: 1778912
this doesnt make sense, NT does NOT use the autoexec.bat file. The only autoexec present in NT is autoexec.NT that handles CMD sessions.. I think you have to clarify what you want to do.
0
 
LVL 1

Author Comment

by:hank1
ID: 1778913
I run batch (perl rexx dos)etc in dos and NT.  Some use the
32api - some don't - but do use envs set here.  Perhaps
this autoexec.NT is refreshed at boot.  The autoexec.bat
is read, however, because the nt path changes if I change it.
Humm -  will look into *.nt however.  I admit I do not know
the nt boot sequence and probably should investigate it.
Question remains.  Can execution (or whatever) be modified
base on booted OS?

0
 
LVL 12

Expert Comment

by:j2
ID: 1778914
For once, NT will NOT read any autoexec.bat it only reads the Autoexec.NT when you initiate a CMD session under NT.

It is however auite easy to set enviromental variables in NT, just enter them in controlpanel/system/enviroment or use the SET command in a CMD window (similar to a DOS W95 system) then you can use teh variables in IF THEN statements in a batch file
0
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 
LVL 1

Author Comment

by:hank1
ID: 1778915
I just looked in system32\autoexec.nt and is says it
does or does not read the autoexec.bat and it is based on
on an applications PIF.  Thanks so far but the question remains.
Since both boots run the same programs.  If the answer
is in this PDF I'll give you the points.  I will also try
your control panel example - but I suspect - since the
autoexec.bat is being read (by who knows) the exercise will
fail.  Thanks for you help.  Be back by friday with, I hope,
the problem solved.

0
 

Expert Comment

by:matz
ID: 1778916
you can set the registry so NT never reads autoexec.bat and then use that file for Dos and then put all your NT stuff in autoexec.nt. I fyou would like that please tell me that you like that answer.
0
 

Accepted Solution

by:
Guenter052197 earned 100 total points
ID: 1778917
I suggest you keep the configuration for DOS and WinNT completely separated.  Use C:\AUTOEXEC.BAT for DOS, only.  However, to do so you have to set the following registry entry
HKEY_CURRENT_USER\Software\Microsoft\Windows\Current Version\
Policies\Explorer\ParseAutoexec to "0".  If you have WinNT Workstation this has to be done manually for every user.  If you have the Server version there should be a tool (SystemPoliciesEditor ?) to do it for an entire group of users.

To set environment variables for WinNT use Control Panel - System - Environment.  You will need Administrator priveleges to set variables for all users.

To set a different environment for all DOS-Programs under WinNT modify %SystemRoot%\System32\Autoexec.nt.  You can also create a more specific autoexec file for a particular application and assign it via Properties.
            
0
 

Expert Comment

by:matz
ID: 1778918
Yes, that's how it should be done.
0
 
LVL 1

Author Comment

by:hank1
ID: 1778919
Thank you both Matz and Guenter.  It great to get responses
like yours.  Thanks again! - if you ever have a perl question...
0

Featured Post

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question