What is the syntax of a system path in 95? I need to create one in the autoexec.bat I think it is.
I can't find the google search result I found last night oddly.
Printable View
What is the syntax of a system path in 95? I need to create one in the autoexec.bat I think it is.
I can't find the google search result I found last night oddly.
If you mean setting the default PATH environment variable in a Windows 95 C:\AUTOEXEC.BAT, I believe it was:path=c:\windows;c:\windows\system
Well I am not sure exactly. From what I remember from my Google search result that I can't seem to recreate it used the % sign a couple times.Quote:
Originally Posted by SpywareDr
I am using a DOS tool from a dos command prompt. I need for the system to be able to call the dos tool from whatever directory I'm in in DOS. :)
What is the complete drive:\path for the tool you're trying to use?
c:\BJL\BJL_Uploader
To reset the PATH environment variable temporarily, at the DOS prompt type:set path=%path%;c:\bjl\bjl_uploaderTo reset it permanently, edit the C:\AUTOEXEC.BAT and add the following to the end of the existing PATH statement line:;c:\bjl\bjl_uploader(Then reboot for the change to take effect).
OK I just did a path=c:\bjl\bjl_uploader because my autoexec.bat didnt seem to have any kind of path statement at all in it.
Recommend:path=c:\windows;c:\windows\system;c:\bjl\bjl_uploader
Thank you. :)
You're welcome. :)
Alright, I got something related to it. I downloaded a related archive. Following its readme instruction I put it in the root directory of my HD. It also instructs me to set these setpaths in autoexec.bat:
set PATH=%PATH%;C:\JAGUAR\BIN
set RDBRC=C:\JAGUAR\BIN\RDB.RC
set DBPATH=C:\JAGUAR\BIN
set ALNPATH=C:\JAGUAR\BIN
set MACPATH=C:\JAGUAR\INCLUDE
set GCC_EXEC_PREFIX=C:/JAGUAR/BIN
set TEMP=C:
Was mildly curious about why it was having me modify the permanent setpath with the %. It's ok to do it this way I'm assuming then. I'm also assuming I can put them all on the same line seperated by the semicolon as well?
The line:set path=%path%;c:\jaguar\binsimply appends:;c:\jaguar\binto the end of your current PATH. So, if your current PATH was say:c:\windows;c:\windows\system;c:\bjl\bjl_uploaderafter doing a:set path=%path%;c:\jaguar\binyour new PATH would be:c:\windows;c:\windows\system;c:\bjl\bjl_uploader;c:\jaguar\binNote: You can type "path" (sans the quotes) to view your current path.
The lines:set rdbrc=c:\jaguar\bin\rdb.rcsetup five other environment variables, (unrelated to the PATH environment variable). Presumably these variables are needed by the program you're installing.
set dbpath=c:\jaguar\bin
set alnpath=c:\jaguar\bin
set macpath=c:\jaguar\include
set gcc_exec_prefix=c:/jaguar/bin
Note: You can view what's in the environment by typing "set" (sans the quotes). If there are a number of variables and they scroll off the top of the screen, use the command "set|more" (sans the quotes) instead.
The last line:set temp=c:is not a good idea. For one it's missing a directory (even if it was just "\" [the 'root' directory]). Two, most people don't want a whole slew of temporary files cluttering up the root directory of drive C:. Better to leave it alone or add the following three lines to your C:\AUTOEXEC.BAT file:md c:\tempThe first line makes sure you have a "\temp" directory on drive C: and the second two lines simply point the "temp" and "tmp" environment variables to it.
set temp=c:\temp
set tmp=c:\temp
Hi All:
Win95 appends whatever you have listed in your AUTOEXEC.BAT to
PATH=C:\WINDOWS;C:\WINDOWS\COMMAND
when it boots.
If you have (only) this line in your AUTOEXEC.BAT:
PATH=C:\jaguar\bin
after you've booted up, you will find the path has become:
PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\jaguar\bin
automatically.
Jerry
I'll leave out the temp=c: part. I dont like temp files cluttering up my root drive either. Why in the hell did they put that in there come to think of it? That's stupid.
You guys have been most helpful. :)
I've downloaded the djgpp C/C++ development package and it wants me to set these system paths in 95:
set PATH=C:\DJGPP\BIN;%PATH%
set DJGPP=C:\DJGPP\DJGPP.ENV
All the sudden everything wants me to set system paths which is something I've never done before. I hope nothing conflicts.
Wait, the instructions say instead of changing my global enviroment I can add this to the djgpp folder:
@echo off
set PATH=c:\djgpp\bin;%PATH%
set DJGPP=c:\djgpp\djgpp.env
chdir c:\djgpp\mystuff (or any other directory)
command
(you can replace that last line with any other shell you'd like)
Not sure what it means by the chdir c:\djgpp\mystuff (or any other directory)
command
(you can replace that last line with any other shell you'd like)
I would like to do this .bat in the djgpp directory instead of changing my global enviroment. However that last part has me scratching my head. Any clarity would be appreciated. :)
Recommend changing that:set path=c:\djgpp\bin;%path%to:set path=%path%;c:\djgpp\binThe:set djgpp=c:\djgpp\djgpp.envis fine. (It shouldn't effect anything other DJGPP).
The:chdir c:\djgpp\mystuffmeans change directory into the c:\djgpp\mystuff directory. (The command "cd" does exactly the same thing as "chdir"). However, since this command will only put you in the c:\djgpp\djgpp.env directory if you are already on drive C:, recommend changing that one line to the following two lines:c:By that last line, the:
cd c:\djgpp\mystuffcommandmeans you could type command to load the command shell (the one that ships with DOS and Windows) or, "you can replace that last line with any other shell you'd like". I don't know why you'd want to load any other command shell at this point. If you're at the DOS/CMD prompt, you're already in a shell.
(you can replace that last line with any other shell you'd like)
Note: With most 'DOS' commands you can type the command followed by a space and then a "/?" to get a little help. For example:chdir /?
cd /?
dir /?
set /?
path /?
command /?
I think I get this. If I understand right, what this does is automatically put me into the djgpp directory when I go to the dos command prompt correct? And the 'mystuff' which is whatever directory I created to hold my C programs and such in right? Incidentally, I went ahead and named it MYSTUFF. :)Quote:
chdir c:\djgpp\mystuff
means change directory into the c:\djgpp\mystuff directory. (The command "cd" does exactly the same thing as "chdir"). However, since this command will only put you in the c:\djgpp\djgpp.env directory if you are already on drive C:, recommend changing that one line to the following two lines:
c:
cd c:\djgpp\mystuff
As I have only one HD on this system I wouldn't worry about the C: part. However in the future I may have other drives/partitions on here so I'll put it in anyway. ;)
So I'll just ignore all this last part then since it seems kinda pointless.Quote:
By that last line, the:
command
(you can replace that last line with any other shell you'd like)
means you could type command to load the command shell (the one that ships with DOS and Windows) or, "you can replace that last line with any other shell you'd like". I don't know why you'd want to load any other command shell at this point. If you're at the DOS/CMD prompt, you're already in a shell.
I've made the changes you recommended. Thank you again for you time and help. :)
Since there is usually more than one way to get where you want to be with the "cd" command, might be best to start with a few examples ...
If are already anywhere on drive C:,If you're in the root directory of drive C:,
- the command:
cd\or:cd \will put you in the root directory of drive C: ("C:\")
- the command:
cd\windowsor:cd \windowsor:cd c:\windowswill place you in the "c:\windows" directory
- the command:
cd\windows\systemor:cd \windows\systemor:cd c:\windows\systemwill put you in directory "c:\windows\system"If you were in "c:\windows", the command:
- the command:
cd windowswill also put you in "c:\windows",
- and the command:
cd windows\systemwould put you in "c:\windows\system"cd systemwould put you in "c:\windows\system".
You can move up a directory by using the command:cd ..For example, to go from "c:\windows\system" to "c:\windows" you can type:cd ..or:cd \windowsor:cd c:\windowsLet's say you were in "c:\windows\system" and you wanted to change into the "c:\windows\fonts" directory. You could either type:cd\windows\fontsor:cd \windows\fontsor:cd c:\windows\fontsor simply:cd ..\fonts(".." = up a directory into "windows" then "\fonts" = down a directory into "fonts").
For comparision, if you were to try and do a:cd \fonts(no leading ".."'s) from within "c:\windows", DOS would try and change you into a "c:\fonts" directory. If it doesn't exist, DOS will return the error "The system cannot find the path specified".
And finally, let's say you were in "c:\windows\system" and changed to drive A: with the command:a:If you were then to issue the command:cd c:\the results would not be immediately evident. However, whenever you do decide to go back to drive C: with the command:c:you would no longer be in "c:\windows\system" but in "c:\".
---
So, back to your "chdir c:\djgpp\mystuff" command. If:then yes, the command:
- you are already on drive C:, and
- the directory "c:\djgpp" exists, and
- the directory "c:\djgpp" contains a subdirectory named "mystuff",
chdir c:\djgpp\mystuffwill change you into the "c:\djgpp\mystuff" directory.
If you weren't on C: though, DOS will have changed the location while on C: to "c:\djgpp\mystuff" but you could actually still be located on any other drive.
And of course, if any of the directories specified in your command do not exist, DOS will display an error message.
Starting to make more sense or have I made it even more confusing? :( :)
This is what the new setpath additions look like on my Autoexec.bat:
path=c:\windows;c:\windows\system;c:\bjl\bjl_uploader
set PATH=%PATH%;C:\JAGUAR\BIN
set RDBRC=C:\JAGUAR\BIN\RDB.RC
set DBPATH=C:\JAGUAR\BIN
set ALNPATH=C:\JAGUAR\BIN
set MACPATH=C:\JAGUAR\INCLUDE
set GCC_EXEC_PREFIX=C:/JAGUAR/BIN
set path=%path%;c:\djgpp\bin
set DJGPP=C:\DJGPP\DJGPP.ENV
c:
cd c:\djgpp\mystuff
Upon reboot though and going to the ms dos prompt on the start menu, it still starts me out at c:\Windows>
Another thing is is I may have 2 C compilers on the system altogether. Although DGJPP runs fine with no hiccups so far, the docs recommend not affecting the global enviroment and creating a shortcut .bat file if more than one compiler is on the computer.
It doesn't really explain it all that clearly. I think it means an autoexec.bat file in the DGJPP directory but I'm not sure.
The PATH environment variableQuote:
Originally Posted by A31Chris
A definition:The PATH (or SET PATH) command sets the command path in the PATH environment variable. The PATH contains the set of directories used to search for executable files. Used without parameters, the PATH command displays the current command path.The only "setpath" environment variables (that you refered to above) are ones that begin with:All the other SET commands in your C:\AUTOEXEC.BAT file are unrelated to the PATH. (Apparently they are setting up various other environment variables needed by your two compilers).
- set path=
or:
- path=
The first "setup-a-path" command in your C:\AUTOEXEC.BAT file:path=c:\windows;c:\windows\system;c:\bjl\bjl_uploaderdoes exactly what it looks like it will do ... set the PATH environment variable to be equal to:c:\windows;c:\windows\system;c:\bjl\bjl_uploaderThe second path command:set path=%path%;c:\jaguar\binmeans reset the PATH environment variable to %PATH% (i.e., "whatever is already set in the PATH environment variable") plus:;c:\jaguar\binIn other words, append the string:;c:\jaguar\binto the end of whatever is already is stored in the PATH environment variable.
The third path command in your C:\AUTOEXEC.BAT file:set path=%path%;c:\djgpp\binappends the string:;c:\djgpp\binto the end of the current PATH environment variable.
So, when DOS executed the first PATH-type command in your C:\AUTOEXEC.BAT file, the PATH environment variable looked like so:path=c:\windows;c:\windows\system;c:\bjl\bjl_uploaderAfter DOS executed the second PATH command in your C:\AUTOEXEC.BAT file, the PATH environment variable looked like so:path=c:\windows;c:\windows\system;c:\bjl\bjl_uploader;c:\jaguar\binAnd finally, after DOS executed the third path command in your C:\AUTOEXEC.BAT file, the PATH environment variable looked like so:path=c:\windows;c:\windows\system;c:\bjl\bjl_uploader;c:\jaguar\bin;c:\djgpp\binSo, if you wanted to make your C:\AUTOEXEC.BAT file more efficient, you could replace all three PATH command lines with simply one:path=c:\windows;c:\windows\system;c:\bjl\bjl_uploader;c:\jaguar\bin;c:\djgpp\bin
More info:
The C:\AUTOEXEC.BAT, Environment and Current drive:\pathQuote:
Originally Posted by A31Chris
The lines in the C:\AUTOEXEC.BAT file are executed (one at a time, and in order), upon startup (bootup) and then the AUTOEXEC.BAT file is closed and forgotten until the next boot.
So, those last two lines in your C:\AUTOEXEC.BAT file simply change you to drive C: and then Change your Directory into c:\djgpp\mystuff. DOS then closes the C:\AUTOEXEC.BAT file, Windows closes the DOS command window and continues to load itself.
In other words, since nothing apparently needs to be done while you're in your c:\djgpp\mystuff, (because there are no more line in your C:\AUTOEXEC.BAT file), those last two lines are not needed. (They're just slowing your boot up time a millisecond or two).Windows will remember the environment variables that are set in the C:\AUTOEXEC.BAT file but not the last drive:\path location after it exits (closes) the file.If you want your MS-DOS prompt (or CMD prompt) icon to start in a directory other than the one it's currently starting in, right-click it, select Properties and change (edit) the drive:\path that's in the Start in: box.
The only AUTOEXEC.BAT file that DOS will automatically run (use) is the one that's in the root directory of the boot drive ... and then only once upon bootup. Any other BATch file that you want to create/use can be named anything you like. (Something that makes more sense then AUTOEXEC.BAT).Quote:
Originally Posted by A31Chris
If you want you could setup two different BATch files, (with two new shortcut icons on your Desktop), to setup whatever environment variables are needed for each compiler. When you are done with either compiler, (type exit in the command window), Windows would close the DOS window and everything that was setup in the environment for that particular session would be forgotten.The environment variables setup in the C:\AUTOEXEC.BAT file are set in the Master (Global) environment. After Windows boots up, and you subsequently start a DOS session, the environment variables in the Master environment are copied over to your Child session. When Windows closes that Child session, any alterations to the environment while in the Child session are forgotten. (The environment variables that were in the Master environment remain unchanged).So, back to what I think you might be trying to accomplish. Create two separate BATch files that setup two different environments and launch two different programs. For example (edit as necessary):Now create two new shortcuts on your Desktop, one pointing to your new c:\windows\djgpp.bat file and the other to your new c:\windows\jaguar.bat file.
- c:\windows\djgpp.bat
Code:@echo off
set path=%path%;c:\djgpp\bin
set djgpp=c:\djgpp\djgpp.env
c:
cd c:\djgpp
djgpp.exe
- c:\windows\jaguar.bat
Code:@echo off
set path=%path%;c:\jaguar\bin
set rdbrc=c:\jaguar\bin\rdb.rc
set dbpath=c:\jaguar\bin
set alnpath=c:\jaguar\bin
set macpath=c:\jaguar\include
set gcc_exec_prefix=c:/jaguar/bin
c:
cd\jaguar
jaguar.exe
Note that you don't have to store these BATch files in C:\Windows. They can be placed wherever. Recommend putting them in a directory that's listed in your PATH though so they could be easily executed (launched) any time you're at a DOS prompt. (Just type the name of the BATch file).If you think you may need to jump from one compiler to the other while in a single DOS session, you may want to have the BATch file that launches Compiler1 to erase any environment variables that may exist for Compiler2. And in turn, the BATch file that launches Compiler2 to erase any environment variables that may exist for Compiler1.
However, if you think you may be running both at the same time, I'd leave the BATch files alone and cross my fingers that the two programs behave themselves. :)
No I'm pretty sure I'll be using them seperately. Thanks for the help. I'm going to save the setpaths for DGJPP and Jaguar/gcc in seperate notepad files. Then I'll rename them with the .bat extension.
I'll put the djgpp one in the dgjpp directory and the jaguar.bin on its directory and create shortcuts to the individual .bat files. That way I'll activate whatever .bat file I need for that session. Hmmm...I didnt think it would be this easy, unless I'm missing something. Thanks. :)
You're welcome. :)