dos environment variables are not behaving in xp

O

ouch

I have tried everywhere to find an answer but no one
seems to know.

I had batch utilities that wrote to the dos environment
table but to my disgust XP refuses to let them work
correctly. so I set off to make my own in any dos
language I could find. but the way xp handles them now is
obsured, and down right wrong.

it is IMPOSSIBLE to send environment variables from one
program to another in dos through xp.

setting them with a shell like command to dos loses them
because the shell ends thus reseting the table.

I found a program called setenv.exe to write to the
registry environment table in xp, but cmd only updates
from that when it is closed and restarted.

I tried desperatly to find a way to automate shutting
down and resetting cmd.

useing start doesn't work (even with /I!)
simply executing the file doesn't work
out of despairity I even tried call

how can you make 2 dos programs communicate with
enviroment variables if XP forbids it? this makes batch
files COMPLETLEY Useless.

also set /p and the other "advanced features" are nice
but no where near the complexity I need.
 
L

Lem

ouch said:
I have tried everywhere to find an answer but no one
seems to know.

I had batch utilities that wrote to the dos environment
table but to my disgust XP refuses to let them work
correctly. so I set off to make my own in any dos
language I could find. but the way xp handles them now is
obsured, and down right wrong.

it is IMPOSSIBLE to send environment variables from one
program to another in dos through xp.

setting them with a shell like command to dos loses them
because the shell ends thus reseting the table.

I found a program called setenv.exe to write to the
registry environment table in xp, but cmd only updates
from that when it is closed and restarted.

I tried desperatly to find a way to automate shutting
down and resetting cmd.

useing start doesn't work (even with /I!)
simply executing the file doesn't work
out of despairity I even tried call

how can you make 2 dos programs communicate with
enviroment variables if XP forbids it? this makes batch
files COMPLETLEY Useless.

also set /p and the other "advanced features" are nice
but no where near the complexity I need.

I sorry I can't help you specifically, but XP seems to be a littly
quirky when it comes to environment variables. First of all, there are
both system-wide environment variables and per-user environment
variables. It's possible to have a system environment variable with the
same name as a user environment variable. It's not clear to me, but
from my experience, the system environment appears to take precedence.
Remember that the XP command emulator is not really DOS -- and the
emulator developers may not have completely replicated all DOS behavior.

It will move you to the beginning of a new learning curve, but depending
on what you're trying to do, you might want to look into Windows
scripting or one of the other scripting languages rather than trying to
keep your old batch files going.
 
A

Alex Nichol

ouch said:
I had batch utilities that wrote to the dos environment
table but to my disgust XP refuses to let them work
correctly. so I set off to make my own in any dos
language I could find. but the way xp handles them now is
obsured, and down right wrong.

it is IMPOSSIBLE to send environment variables from one
program to another in dos through xp.

Probably. You must realise that XP Does not provide true DOS, but an
emulation in which DOS programs can run in a tightly controlled
environment in which they can use standard DOS calls on their own
behalf, but may *not* access hardware direct, nor try to change settings
of he system
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top