News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Set and Path commands

Started by Robert Collins, July 11, 2005, 05:33:06 AM

Previous topic - Next topic

Robert Collins

What does it mean when I see some instructions say the following?

set something=C:\some_path

path c:\directory_path   

The italicized words are just what I subsitutred for the actual words.

Where do I put these commands and where do they wind up?
 

MichaelW

I'm not sure I understand the question, but I won't let that stop me :toothy

I don't know the details of how Windows handles this, but under DOS the commands would normally go in a batch file and the results would end up in an environment block or blocks. If the commands were in autoexec.bat (or config.sys?) the results would end up in the master environment maintained by the command processor that was loaded when the system was started. If the commands were in some other batch file then the results would (at least effectively) end up in a local environment block that was discarded when the batch file terminated. My experience has been that DOS batch commands work under Windows essentially the same as they would under DOS. Running this batch file under Windows 2000, the set and path commands seem to work as they would under DOS.

set
pause
path %path%;c:\directory_path
set something=C:\some_path
set
pause
path %something%
set
pause

eschew obfuscation

hutch--

Robert,

The environment block is basically a string table that the OS will scan to get a string IF it is set in the environment block. The other factor is that the app must be designed to read or test the environment to get the string data. Under Windows with either COMMAND.COM or the NT based CMD.EXE, you retain an environment for the duration of the  instance of the command interpreter.

Have a look in a batch file called MAKEIT.BAT in the MASM32 example8 directory under the heading ALTBUILD. It shows somew of the uses for environment strings put in place with SET.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Robert Collins

OK, I was trying to build the Firefox system. On the directions it said to do the following:

SET MOZ_TOOLS=C:\moztools

and then it said to do the following:

PATH=moztools\bin

Well, I didn't know how to do that so I posted the above question. On the Mozilla site I posted the same question and someone responded back saying to enter into the DOS PROMPT and type it in. Well, if I enter only the SET command without any parameters I get the following info:

TMP=C:\windows\TEMP
TEMP=C:\windows\TEMP
PROMPT=$p$g
winbootdir=C:\windows
PATH=c:\WINDOWS; C:\windows\ C:\windows\COMMAND
COMSPEC=C;\windows\COMMAND.COM
CMDLINE=doskey d=dir S*

However, after I entered the two commands above and then enter the SET command without any parameters I get the following:

TMP=C:\windows\TEMP
TEMP=C:\windows\TEMP
PROMPT=$p$g
winbootdir=C:\windows
COMSPEC=C;\windows\COMMAND.COM
CMDLINE=doskey d=dir S*
MOZ_TOOLS=C:\moztools
PATH=moztools\bin

I noticed that they were added to the environmental commands but I also noticed that the original PATH command didn't contain the
c:\WINDOWS; C:\windows\ C:\windows\COMMAND string. So, this kind of worried me so I went back to the DOS PROMPT and re-entered the SET command and got the following:

TMP=C:\windows\TEMP
TEMP=C:\windows\TEMP
PROMPT=$p$g
winbootdir=C:\windows
PATH=c:\WINDOWS; C:\windows\ C:\windows\COMMAND
COMSPEC=C;\windows\COMMAND.COM
CMDLINE=doskey d=dir S*

I noticed that the original settings were restored but I lost the two that I entered. Well, this told me that what I had entered was good for that DOS session only and any subsequent DOS sessions would resort back to the original settings.

Well, I don't want to have to type these two settings each time so my question about where do they wind up means are they placed in some kind of a file or are they in the registry or where? They must be somewhere because they are always present whenever I reboot but mine are gone each time. I want to place mine in the same place as the originals so I don't have to do it each and every time. I looked in all the normal files that you see by doing a SYSEDIT but none of the system files contain any of this information.

Rifleman

Robert,
In XP, click Start, Settings and Control Panel.  Click the System Icon.  Click the Advanced Tab and near the bottom of the box you will see a button labeled Environment Variables.  Clcik it and you will then see all the settings.  You can click and edit any line, always be careful.  Any changes that you make here are permanent.  They will be there from boot to boot.

Paul

Robert Collins

Well I wish I had XP but I don't. I only have 98. There is no Advanced Tab on the system control panel box. I know I can add these commands to the autoexec.bat file but that is not where all the default settings are. I tried looking in the registry but no luck. They must be kept somewhere else how would Windows know what to set as defaults?

MichaelW

Under Windows 98 one convenient method would be to start the System Configuration Editor, add the commands to Autoexec.bat, then exit from the editor and restart the system. I think the specified path should probably be appended to the current path, like so:

path=%path%;moztools\bin

After the system restarts, run a set command with no arguments to check the results.
eschew obfuscation

Robert Collins

Quote from: MichaelW on July 11, 2005, 08:40:40 PM
Under Windows 98 one convenient method would be to start the System Configuration Editor, add the commands to Autoexec.bat, then exit from the editor and restart the system. I think the specified path should probably be appended to the current path, like so:

path=%path%;moztools\bin

After the system restarts, run a set command with no arguments to check the results.


Well that's what I did using SYSEDIT and placed them in the autoexec.bat file but that's not what I am wanting to know. I don't want to make a big deal out of this cause it's just curiosity on my part as to where the default settings are kept. And yes, I had to append the path to the end of the already existing path and put in in the bat file as you indicated above. That works fine but still, my curisoty is running wild again and one way or another I am gonna find out where those defaults are kept even if I have to travel the world over :bdg

skywalker

Quote from: Robert Collins on July 11, 2005, 05:47:10 PM
Well I wish I had XP but I don't. I only have 98. There is no Advanced Tab on the system control panel box. I know I can add these commands to the autoexec.bat file but that is not where all the default settings are. I tried looking in the registry but no luck. They must be kept somewhere else how would Windows know what to set as defaults?

Nothing wrong with 98, I still use it at the house and quite stable. I recently got a new job, and have
Win 95,2000, and XP on three instruments. So far, I would say that Win 2000 or XP don't have anything
"to write home about." :-)

If you'll restate what you would like, I would be happy to help.

Andy