Is it possible to programmatically change the path?

Posted on 1998-08-13
Last Modified: 2013-12-16
What we're trying to do is programmatically append our directory to the path (permanently) during setup. It's a simple little .exe on NT, but the only way we know to do it on 9x is to modify autoexec.bat and reboot. Any suggestions?
Question by:barrett
  • 2
  • 2

Expert Comment

ID: 1757643
Have you tried:

PATH=%PATH%;"new directory"



Author Comment

ID: 1757644
Yes, we could take this approach, but my PM doesn't want to munge autoexec.bat, so we're kind of stuck. All the replies I've received so far tall me that there is no other way to do it under Win9x.
LVL 10

Accepted Solution

MasseyM earned 100 total points
ID: 1757645
You can run the PATH command at the DOS prompt... that would eliminate the need to reboot, but AUTOEXEC.BAT is the only place where the "paths" are set 9other than the permanant "windows" paths... They are located in your registry.


Expert Comment

ID: 1757646
PM ??

You don't have to include the statement in the autoexec.bat file.  Simply issue it from a Dos prompt.

You could also write a simple batch file to change to the new directory and then call the program.

Let me know exactly what you are trying to do.......



Author Comment

ID: 1757647
You're both right, of course, and the only solution appears to be what MsDev does w/ its vcvars.bat file. We were hoping for a persistent solution that doesn't require setting the PATH in each new DOS box w/ a .bat file (NT is so much nicer). The bug against our setup calls for this change to be made once, during installation, so it's invisible to the user. Probably not gonna happen, though.

BTW: PM is MS-speak for "Program Manager".

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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). …
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…

707 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

17 Experts available now in Live!

Get 1:1 Help Now