Dos variable

My question is:

How can I set a DOS environment variable in my code?

Comments

  • : My question is:
    :
    : How can I set a DOS environment variable in my code?
    :
    :

    What for? Your program already knows what you want to set...
    Post some details

    Iby

  • : My question is:
    :
    : How can I set a DOS environment variable in my code?

    I remember looking at the source to an old BBS package that would change the PATH environment variable when you shelled to the OS (so it included a message saying "Type EXIT To Return" type thing), and it looked to be quite the hack job.

    If you're interested in looking, the source is distributed in an archive called sg20src.zip. Unfortunately it's like 10 megs and you only need a couple files, so that's really overkill. Maybe someone else will have an answer for you though.
  • : What for? Your program already knows what you want to set...
    : Post some details
    :
    : Iby
    :
    Ok,It is something like this:
    C:/>read name
    (*now reading*)
    georg_

    My question is: how can I set the paramstr(1) "name" into a DOS environment variable with the read(past) string assigned?
    Then:
    echo %name%
    george

    Thank you for your time.
    (sorry, english is not my default language).
  • : : What for? Your program already knows what you want to set...
    : : Post some details
    : :
    : : Iby
    : :
    : Ok,It is something like this:
    : C:/>read name
    : (*now reading*)
    : georg_
    :
    : My question is: how can I set the paramstr(1) "name" into a DOS environment variable with the read(past) string assigned?
    : Then:
    : echo %name%
    : george
    :
    : Thank you for your time.
    : (sorry, english is not my default language).
    :


    I am not aware of any pascal command for setting
    enviroment variables. However this can be achived
    by running exec() command. This however could be
    limited to current sesion.
    Reading of environment vriables is easy. Just check
    example in help on GetEnv().


    Iby
  • : My question is:
    :
    : How can I set a DOS environment variable in my code?
    :
    :
    i assume you are using turbo/borland pascal.
    open the help and look for GetEnv or SetEnv
  • : : My question is:
    : :
    : : How can I set a DOS environment variable in my code?
    : :
    : :
    : i assume you are using turbo/borland pascal.
    : open the help and look for GetEnv or SetEnv
    :
    [blue]
    Yes, I use Borland Pascal With Objects 7.0
    But the procedure SetEnv does not exist
    (sorry english in not my native language)
    [/blue]
  • : : : My question is:
    : : :
    : : : How can I set a DOS environment variable in my code?
    : : :
    : : :
    : : i assume you are using turbo/borland pascal.
    : : open the help and look for GetEnv or SetEnv
    : :
    : [blue]
    : Yes, I use Borland Pascal With Objects 7.0
    : But the procedure SetEnv does not exist
    : (sorry english in not my native language)
    : [/blue]
    :
    you are right, my mistake.
    i looked around and found a DosEnv unit you might find useful. didnt
    test it though.

    in there ==> http://atlas.csd.net/~cgadd/knowbase/DOS0039.HTM
  • [blue]
    OK, it works fine.
    thank you for your time. :-)
    [/blue]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories