Solved

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

Posted on 1997-06-17
8
359 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
 
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

A Bare Metal Image backup allows for the restore of an entire system to a similar or dissimilar hardware. They are highly useful for migrations and disaster recovery. Bare Metal Image backups support Full and Incremental backups. Differential backup…
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup". After a while, you have entered a loop for Auto repair which does not fix anything and you will be in a  panic as all your work w…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

747 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now