473,387 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Can I set environment variables under Win-98 ?


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
4 1487
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
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
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

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Greg Lindstrom | last post by:
Hello- I am running python 2.3. on an HP-9000 box running Unix and have a POSIX script that sets up my production environment. I would like to run the script from inside a python routine and...
12
by: zig | last post by:
I've posted this on alt.comp.lang.coldfusion, but is predominantly a javascript problem: I have a CF query which returns several rows of records. I wanted to have a checkbox on each record of...
28
by: Christian | last post by:
Another question from a not even newbie: In Unix you can set an environment variable with the command export PYTHONPATH but I would like to set the variable from at .py script. So my question...
4
by: Bill Davidson | last post by:
All: I've found the 'Environment.GetEnvironmentVariable()' method; but how do I create and/or set an environment variable? Thanks, Bill
4
by: Ron Clarke | last post by:
I have an application that starts other processes. The app needs to create/set a few environment variables when a process starts, let the process run, then remove the environment variables when the...
6
by: Fuzzyman | last post by:
Hello all, I would like to set a Windows Environment variable for another (non-child) process. This means that the following *doesn't* work : :: os.environ = value In the ``win32api``...
3
by: Tristan | last post by:
Hello community: I post this because I could not find satisfactory answers in the posts generated by this nice group. I work on winXP. I have many little python applications in different folders,...
3
by: GIJosh | last post by:
Hi guys. I'm new to python, so go easy. Heres my problem. I've got my main file, Python Paint.py #Python Paint.py from graphics import * import time import functions win =...
3
by: smitty1e | last post by:
Just a fun exercise to unify some of the major input methods for a script into a single dictionary. Here is the output, given a gr.conf file in the same directory with the contents stated below: ...
5
by: meown | last post by:
Hi, I want to use VMware to set up an ASP.NET development environment. My host runs Windows XP and my Virtual Machine is running Win Server 2003. The question is how can I get the 2 operating...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.