1. Set/reset DOS environment variable

How do you programatically set/reset DOS environment variable?

I tried the following but didn't work:

system( "SET MYVAR=02/08/1999", 2 )
i = system_exec( "COMMAND /C SET MYVAR=02/08/1999", 2 )

Can anyone help me on this.

Arlie

new topic     » topic index » view message » categorize

2. Re: Set/reset DOS environment variable

At 04:57 a.m. 12-02-99 -0500, you wrote:
>How do you programatically set/reset DOS environment variable?
>
>I tried the following but didn't work:
>
>system( "SET MYVAR=02/08/1999", 2 )
>i = system_exec( "COMMAND /C SET MYVAR=02/08/1999", 2 )
>
>Can anyone help me on this.
>
>Arlie

It won't work because the envoirment (the one use set on your autoexec.bat)
is different from the new shell you created.

Why you need this? I have a 7-8 pages long C source that can do what you
need, but before typing and translating it to Euphoria I must be sure it's
the only alternative you need.

Regards,
        Daniel   Berstein
        daber at pair.com

new topic     » goto parent     » topic index » view message » categorize

3. Re: Set/reset DOS environment variable

At 07:47 AM 2/12/99 -0400, you wrote:
>At 04:57 a.m. 12-02-99 -0500, you wrote:
>>How do you programatically set/reset DOS environment variable?
>>
>>I tried the following but didn't work:
>>
>>system( "SET MYVAR=02/08/1999", 2 )
>>i = system_exec( "COMMAND /C SET MYVAR=02/08/1999", 2 )
>>
>>Can anyone help me on this.
>>
>>Arlie
>
>It won't work because the envoirment (the one use set on your autoexec.bat)
>is different from the new shell you created.
>
>Why you need this? I have a 7-8 pages long C source that can do what you
>need, but before typing and translating it to Euphoria I must be sure it's
>the only alternative you need.
>
>Regards,
>        Daniel   Berstein
>        daber at pair.com
>
Hi Daniel,

I want to use this for IPC (inter-process communication) so that a program
can tell if an instance of itself is already running. Sort of TSR under
windows 95. I thought that setting DOS env. var. was the simplest way to do
it.

Regards,
Arlie Codina

new topic     » goto parent     » topic index » view message » categorize

4. Re: Set/reset DOS environment variable

Creating a file would probably be the easiest way to do that.
OR using an initialztion file.  Read it and then update it
letting it know that you are running.  Then when you are
closing. Update it letting it know that you are No longer
running.  With an Running_ID you could have mutltiple
instances running and aware of each other.  Then when one
process was closing it would remove its ID from the stack
of currently running ID's.
Of Course.  You need to make sure that you have the file
closed while under normal operations.  Only open it long
enough to find the current running_ID's and then.
Another Idea of inter_process communication could be
allocating some memory.  But first they have to know if
another process is running.

I will build an example.  and send it to you OR if requested
I will send it to the list.

      Lucius L. Hilley III

On Fri, 12 Feb 1999 23:57:12 +0800, Arlie Codina <arlie.codina at USA.NET>
wrote:

>At 07:47 AM 2/12/99 -0400, you wrote:
>>At 04:57 a.m. 12-02-99 -0500, you wrote:
>>>How do you programatically set/reset DOS environment variable?
>>>
>>>I tried the following but didn't work:
>>>
>>>system( "SET MYVAR=02/08/1999", 2 )
>>>i = system_exec( "COMMAND /C SET MYVAR=02/08/1999", 2 )
>>>
>>>Can anyone help me on this.
>>>
>>>Arlie
>>
>>It won't work because the envoirment (the one use set on your autoexec.bat)
>>is different from the new shell you created.
>>
>>Why you need this? I have a 7-8 pages long C source that can do what you
>>need, but before typing and translating it to Euphoria I must be sure it's
>>the only alternative you need.
>>
>>Regards,
>>        Daniel   Berstein
>>        daber at pair.com
>>
>Hi Daniel,
>
>I want to use this for IPC (inter-process communication) so that a program
>can tell if an instance of itself is already running. Sort of TSR under
>windows 95. I thought that setting DOS env. var. was the simplest way to do
>it.
>
>Regards,
>Arlie Codina

new topic     » goto parent     » topic index » view message » categorize

5. Re: Set/reset DOS environment variable

------=_NextPart_000_001A_01BE5689.ACCA4D00
        charset="iso-8859-1"

>
>I will build an example.  and send it to you OR if requested
>I will send it to the list.
>
Send it to the list please.

------=_NextPart_000_001A_01BE5689.ACCA4D00
        name="Adam W Weeden.vcf"

new topic     » goto parent     » topic index » view message » categorize

6. Re: Set/reset DOS environment variable

How do you programatically set/reset DOS environment variable?

I tried the following but ddn't work:

system( "SET FREEZEDATE=02/08/1999", 2 )
i = system_exec( "COMMAND /C SET FREEZEDATE=02/08/1998", 2 )

Can anyone help me on this.

Arlie

new topic     » goto parent     » topic index » view message » categorize

7. Re: Set/reset DOS environment variable

I'd like to second on that...  Send it to the list too.. =|:o)   Hehehe

   Austin C. (aka The AfterBeat)

Adam Weeden wrote:

> >
> >I will build an example.  and send it to you OR if requested
> >I will send it to the list.
> >
> Send it to the list please.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu