Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 1997-06-17
8
Medium Priority
?
368 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 400 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

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!

Question has a verified solution.

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

I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
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 is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

610 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