[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 1997-06-17
8
Medium Priority
?
370 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
MS Outlook undoubtedly is the most widely used email client.Its user-friendliness, cost effectiveness, and availability with Microsoft Office Suite make it the most popular email application.  Its compatibility with Microsoft applications like Exch…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

867 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