- Sep 4, 2000
- 482
- 0
- 0
This is really round about, but what I would like to do is to get the active partition # from "pqboot.exe /s" which gives something like:
PQ Boot -- Version 1.0
Copyright (c) 1994-1996 PowerQuest Corporation
All Rights Reserved
================================== Disk 1 ==================================
ID Volume Type Status Size(MB) Used(MB) Free(MB)
-- --------------- ------------ ---------------- -------- -------- --------
1 *: Unknown 09 Primary 31.3 31.3 0.0
>2 C:NEWONE FAT Primary,Bootable 894.2 894.2 0.0
which obviously doesn't look like much scrunched up, but the text does tell you which partition is active and I think I can just parse the text, either in a file (even more round a bout) or from the output of the file. Now I have the java program that someone posted in response to a similar question on one of the sun bulletin boards:
===============================
import java.lang.*;
import java.io.*;
public class runDos {
public static void main(String[] args) {
Runtime rt = Runtime.getRuntime();
String[] callAndArgs = { "e:\\pqboot.exe /s", "> e:\\bleh.txt" };
// String[] callAndArgs = { "Notepad.exe",
// "e:\\pqboot.exe /s" };
try {
// Process child = rt.exec(callAndArgs);
// child.waitFor();
// System.out.println("Process exit code is: " + child.exitValue());
Process p = Runtime.getRuntime().exec(callAndArgs);
}
catch(IOException e) {
System.err.println("IOException starting process!"
;
}
// catch(InterruptedException e) {
// System.err.println("Interrupted waiting for process!"
;
// }
}
}
========================
pardoning the comments, the part with notepad which I commented out works, but when I tried to run "pqboot /s" which should display something like in the first part above, (1) I get *no* output on the screen, but it sounds like the thing ran (2) when I try to be smart and pipe the output to bleh.txt, it still doesn't do anyout put. I figure that the method/whatchamacallit, doesn't pass the > bleh.txt correctly. Is there some way to actually capture the text that *should* be output to the screen?
If you're wondering about what I am trying to do, I am figuring if I can get the active partition number, and get it stuck in the environment (with something like the "set bleh= x; x an integer"
I can right a batch file to ghost a partition to the active partition on the hard drive, so I don't have to confuse someone with trying to select the right options (whoops I just deleted my whole hard drive, etc.)
I'd also be curious about how to do it in c++, so I could just compile something, rather than have to run java X all the time (and potentially have to throw the run time on a startup disk
I figure the programming to figure out directly what the active partition # is would be kind of complicated... or is it??
"Process p = Runtime.getRuntime().exec(callAndArgs);" was a simplified version of the one commented out. Not *quite* very clear how to works to me...
PQ Boot -- Version 1.0
Copyright (c) 1994-1996 PowerQuest Corporation
All Rights Reserved
================================== Disk 1 ==================================
ID Volume Type Status Size(MB) Used(MB) Free(MB)
-- --------------- ------------ ---------------- -------- -------- --------
1 *: Unknown 09 Primary 31.3 31.3 0.0
>2 C:NEWONE FAT Primary,Bootable 894.2 894.2 0.0
which obviously doesn't look like much scrunched up, but the text does tell you which partition is active and I think I can just parse the text, either in a file (even more round a bout) or from the output of the file. Now I have the java program that someone posted in response to a similar question on one of the sun bulletin boards:
===============================
import java.lang.*;
import java.io.*;
public class runDos {
public static void main(String[] args) {
Runtime rt = Runtime.getRuntime();
String[] callAndArgs = { "e:\\pqboot.exe /s", "> e:\\bleh.txt" };
// String[] callAndArgs = { "Notepad.exe",
// "e:\\pqboot.exe /s" };
try {
// Process child = rt.exec(callAndArgs);
// child.waitFor();
// System.out.println("Process exit code is: " + child.exitValue());
Process p = Runtime.getRuntime().exec(callAndArgs);
}
catch(IOException e) {
System.err.println("IOException starting process!"
}
// catch(InterruptedException e) {
// System.err.println("Interrupted waiting for process!"
// }
}
}
========================
pardoning the comments, the part with notepad which I commented out works, but when I tried to run "pqboot /s" which should display something like in the first part above, (1) I get *no* output on the screen, but it sounds like the thing ran (2) when I try to be smart and pipe the output to bleh.txt, it still doesn't do anyout put. I figure that the method/whatchamacallit, doesn't pass the > bleh.txt correctly. Is there some way to actually capture the text that *should* be output to the screen?
If you're wondering about what I am trying to do, I am figuring if I can get the active partition number, and get it stuck in the environment (with something like the "set bleh= x; x an integer"
I'd also be curious about how to do it in c++, so I could just compile something, rather than have to run java X all the time (and potentially have to throw the run time on a startup disk
I figure the programming to figure out directly what the active partition # is would be kind of complicated... or is it??
"Process p = Runtime.getRuntime().exec(callAndArgs);" was a simplified version of the one commented out. Not *quite* very clear how to works to me...
