1.

Solve : capturing the output of a dos (not ms-dos) program?

Answer» HEY,

So I am currently using dos (not ms-dos, just straight up dos) and am trying to capture the output of a program.

The program returns a single line that shows the processor speed.

e.g.

C:/runprog
Core Duo 1.6

C:/

So what I'm trying to do is put the "Core Duo 1.6" part into a variable. How do I do that?

And if that's not possible, or is a real pain, are there any other ways to put my processor speed into a variable?

Thanks,
darryl"straight up dos" is a new one on me. I have heard of MSDOS, IBMDOS, DRDOS, FREEDOS, and a few more off the wall flavors, but "straight up dos" really has me stumped.

The easiest way is to create an environment variable using the SET command.

set duo = Core Duo 1.6

When you need to use it, %duo% will produce the variable.

To remove the variable, set duo =

To make the variable more permanent, put it in the autoexec.bat so that it will be set on every boot.Well, yes, I could do that... but it doesn't suit my purposes.

The issue is not setting a variable that is always "Core Duo 1.6". I'll give a little more info on what I'm trying to do here...

I am using a network boot cd that automatically installs the drivers onto a computer. The problem is, we have several different kinds of computers, and I am trying to make it so that it automatically installs the right one. As such, I need a model-specific string to compare in order to tell the program what driver to INSTALL. I've GOT everything figured out except how to get the program to distinguish between computers; right now I'm using a choice menu manually, which gets old when you're dealing with lots of computers...

So, I need to get a variable that contains model-specific information. Because the boot cd doesn't have NICE, convinient built-in variables, I am using a program that returns the CPU speed (which is different ACROSS all models). So I need to figure out how to use the returned value.

Thanks,
-darryl


Discussion

No Comment Found