dap1@ihlpf.UUCP (07/12/83)
#N:ihlpf:17100011: 0:632 ihlpf!dap1 Jul 12 7:21:00 1983 Does anybody know how to set environmental variables under DOS 2.0 from inside a program? This would be nice to allow programs to leave small amounts of information lying around without having to kludge a temporary file on disk. Also, my boot drive suddenly died recently and after taking it out and looking at it, there appears to be some sort of string stuck on the head. Is there a safe way of removing this stuff? It's not big enough to manhandle out but is too big to get off with a cleaning disk. Thanks, Darrell Plank
jcw@cvl.UUCP (07/13/83)
When COMMAND invokes a program, inside the program's Program Segment Prefix is a pointer to its environment. However, it is a pointer to a *copy* of the environment of the shell. The upshot is you can modify the environment block to your heart's content but when the program exits that block is freed up and the shell's block has not changed. That is why set has to be an internal command. The only way I can think of to change the shell's env. is to go searching blindly through memory for it, and that's more than slightly gross. A note a few days ago mentioned the ENVIRON statement (undocumented) in BASIC 2.0, that sets environment variables. I thought that since BASIC was done by Microsoft that it might implement some trick to permanently change environment variables. No such luck, they go away too. -Jay Weber {..!seismo!rlgvax!cvl!jcw}