Solved

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

Posted on 1997-06-17
8
364 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Exchange 2016 4 57
windows 10 7 63
Windows 2008 SBS Patch 2 44
Firefox Developer Edition discontinued?  What should I do? 12 50
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
Configuring Remote Assistance for use with SCCM
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

737 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