Can I set environment variables under Win-98 ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tony@tony.com

    #1

    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
  • Erwin Moller

    #2
    Re: Can I set environment variables under Win-98 ?

    tony@tony.com wrote:
    [color=blue]
    >
    > 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[/color]

    Hi tony,

    Win 98? Wow. :-)

    Did you try to use putenv() ??


    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

    Comment

    • tony@tony.com

      #3
      Re: Can I set environment variables under Win-98 ?

      In article <444f6b58$0$316 41$e4fe514c@new s.xs4all.nl>,
      since_humans_re ad_this_I_am_sp am...yourself.co m says...[color=blue]
      > ...[/color]

      Hi Erwin
      [color=blue]
      >
      > Win 98? Wow. :-)[/color]

      yes I like to have a firewall on my internet connection.

      [color=blue]
      > Did you try to use putenv() ??[/color]

      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

      Comment

      • Jerry Stuckle

        #4
        Re: Can I set environment variables under Win-98 ?

        tony@tony.com wrote:[color=blue]
        > In article <444f6b58$0$316 41$e4fe514c@new s.xs4all.nl>,
        > since_humans_re ad_this_I_am_sp am...yourself.co m says...
        >[color=green]
        >>...[/color]
        >
        >
        > Hi Erwin
        >
        >[color=green]
        >>Win 98? Wow. :-)[/color]
        >
        >
        > yes I like to have a firewall on my internet connection.
        >
        >
        >[color=green]
        >>Did you try to use putenv() ??[/color]
        >
        >
        > 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
        >[/color]

        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.
        jstucklex@attgl obal.net
        =============== ===

        Comment

        • tony@tony.com

          #5
          Re: Can I set environment variables under Win-98 ?


          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

          Comment

          Working...