How 2 add directory to PATH from command line (Users)
> EDIT: Never mind! After first posting this I think I just remembered the
> name of that command: APPEND! But now, I don't know how to delete my
> post. Is there a way to do that?
> ----------------------------------------------------------------------------
>
> Today I'm trying to figure out a shortcut for adding a directory to an
> already lengthy PATH statement.
No, I don't think APPEND is what you want. Also keep in mind that a PATH can only be approx. 128 bytes long, at least in most common environments (like your MS-DOS 6.21).
From cmdline, you can change the PATH easily, as mentioned, but most shells, including MS-DOS 6.21's, don't always expand env. vars when setting other environment variables. So "path c:\temp;%PATH%" doesn't work in MS-DOS 6.x (but works in 7.x's COMMAND.COM, IIRC). The workaround is to use a .BAT, since it always works inside there.
In my case, since I sometimes muck with the PATH and want to revert to a known stable state, I keep a file called MYPATH.BAT which switches back to the standard setup. In fact, I even call it from within AUTOEXEC.BAT:
REM N.B. this way avoids hardcoding the filename twice
for %%a in (c:\utils\mypath.bat) do if exist %%a call %%a
And here's MYPATH.BAT:
@echo off
REM mypath.bat
path c:\;c:\fdos\bin;c:\hx\bin;c:\utils
if not "%1"=="" path %PATH%;%1
Complete thread:
- How 2 add directory to PATH from command line - CluelessInSeattl, 07.01.2013, 17:19 (Users)
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- How 2 add directory to PATH from command line - Arjay, 07.01.2013, 18:05
- How 2 add directory to PATH from command line - marcov, 07.01.2013, 18:22
- How 2 add directory to PATH from command line - Arjay, 07.01.2013, 22:07
- How 2 add directory to PATH from command line - marcov, 07.01.2013, 18:22
- How 2 add directory to PATH from command line - Rugxulo, 07.01.2013, 22:33
- How 2 add directory to PATH from command line - marcov, 09.01.2013, 16:55
- How 2 add directory to PATH from command line - Arjay, 07.01.2013, 18:05
Mix view