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 bocke, 18.01.2013, 16:57

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

Or you can create the batch file, run it and than remove it directly from C/C++. IE: create a new file in %TMP% or %TEMP%, write appropriate "set" commands into it, than run %COMSPEC% on it and then unlink (remove) it.

Ugly, but will probably work. I used something along these lines once. Although for my own use, so it wasn't important how crappy the code is if it does the job. :)

 

Complete thread:

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