Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

How to set env. var from C program (Developers)

posted by tom Homepage, Germany (West), 15.01.2013, 13:54

> > In such way you change only your local copy of environment for your
> > program.
> > To make the changes persistent you must change the master environment
> > (look for "DOS master environment" in google)
>
> Hm, that I feared about - you mean there's no standard C function to do
> this. As I try to keep portability over dos/win/linux I don't want
> implement any dirty hack like direct rewriting memory.
there's no way for that from an .EXE file.

BUT: you can write a batch file
SetCPUID.bat
CPUID.EXE > cpuid.bat
call CPUID.BAT


where running CPUID.EXE would print
set CPUID=386


> EDIT: I asked colleagues and there's no way. User would need to use
> grep/awk to filter out the desired text and then use it for SET.
information technology should save users from
'use grep/awk to filter out the desired text and then use it for SET'

in case you didn't notice, this is the year 2013 ;-)

 

Complete thread:

Back to the forum
Board view  Mix view
22762 Postings in 2122 Threads, 402 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum