By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,877 Members | 1,102 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,877 IT Pros & Developers. It's quick & easy.

Can I set environment variables under Win-98 ?

P: n/a

I've tried:

system("set PATH="%PATH%;e:\;c:\");
But that doesnt seem to work.
I thought maybe $_ENV['path='%PATH%;e:\;c:\'];
But no luck.

Can anyone tell me how please?

thanks

tony
Apr 26 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
to**@tony.com wrote:

I've tried:

system("set PATH="%PATH%;e:\;c:\");
But that doesnt seem to work.
I thought maybe $_ENV['path='%PATH%;e:\;c:\'];
But no luck.

Can anyone tell me how please?

thanks

tony


Hi tony,

Win 98? Wow. :-)

Did you try to use putenv() ??
http://nl3.php.net/manual/en/function.putenv.php

Alernatively: Didn't win98 had a file called autoexec.bat that contained the
PATH? Or was that DOS only? Not sure.
Try to open it (need right rights of course) and add your piece of the path.

I suggest you test putenv() first.

Good luck,
Erwin Moller
Apr 26 '06 #2

P: n/a
In article <44***********************@news.xs4all.nl>,
si**********************************...y ourself.com says...
...
Hi Erwin

Win 98? Wow. :-)
yes I like to have a firewall on my internet connection.

Did you try to use putenv() ??


yes the trouble with putenv() is it doesnt seem to work at all under
wondows. (I have PHP version 5.0.2)

It works fine on my linux box but is just ignored by Billy Goats beasty.

I'm trying to make a persistent change that stays there until I change it
back again using PHP without having to use DOS batch files (Which would
as you suggest work - but putting it in a file on the disk would void my
reason for wanting this in the first place).

tony

Apr 26 '06 #3

P: n/a
to**@tony.com wrote:
In article <44***********************@news.xs4all.nl>,
si**********************************...y ourself.com says...
...

Hi Erwin

Win 98? Wow. :-)

yes I like to have a firewall on my internet connection.
Did you try to use putenv() ??

yes the trouble with putenv() is it doesnt seem to work at all under
wondows. (I have PHP version 5.0.2)

It works fine on my linux box but is just ignored by Billy Goats beasty.

I'm trying to make a persistent change that stays there until I change it
back again using PHP without having to use DOS batch files (Which would
as you suggest work - but putting it in a file on the disk would void my
reason for wanting this in the first place).

tony


You can't do it. Win98 only allows a process to change the environment for that
process and it's children. Once the process ends, the environment goes back to
what it was.

It works from a batch file because the process interpreting the batch file is
command.com - the same one which is running your window. But to process a PHP
file, command.com has to start a child process (php.exe). And php.exe can only
change it's environment and those of its children.

About the only thing you might be able to do is run the php program and from
there start a new command.com process. The new one will have the environment
variables you want.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 26 '06 #4

P: n/a

Ooops...

It seems it does work if you use single quotes (I'm in the habit of using
double quotes for everything)

The annoying thing is you dont get an error/warning message it just goes
on interpreting.

thanks for the responses I've got the thing going now.

tony
Apr 26 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.