atombender
asked on
disk volume label
how can i read the volume label of a disk?
i want to build a cd catalog-application
it just has to run on windows
i want to build a cd catalog-application
it just has to run on windows
Correction : (Using Runtime.getRuntime().execu te("cmd") ....
ASKER
unfortunately i have jdk1.3
import java.io.*;
public class Test{
public static void main(String args[])throws Exception{
Runtime rt=Runtime.getRuntime();
Process p=rt.exec("chkdsk f:");
BufferedReader in=new BufferedReader(new InputStreamReader(p.getInp utStream() ));
System.out.println(in.read Line());
System.out.println(in.read Line());
p.destroy();
}
}
OUT PUT IS
The type of the file system is FAT32.
Volume PROGRAMS created 10/22/2001 9:39 AM
Its a bit funny .. but belive me reads the Volume label and type of drive F, there on Windows XP with JRE 1.3.. if ya have ne other progam that could write the Disk Volume you can use instead.. as i used chkdsk.. no internal command i think
points as it works :-) kiddin
public class Test{
public static void main(String args[])throws Exception{
Runtime rt=Runtime.getRuntime();
Process p=rt.exec("chkdsk f:");
BufferedReader in=new BufferedReader(new InputStreamReader(p.getInp
System.out.println(in.read
System.out.println(in.read
p.destroy();
}
}
OUT PUT IS
The type of the file system is FAT32.
Volume PROGRAMS created 10/22/2001 9:39 AM
Its a bit funny .. but belive me reads the Volume label and type of drive F, there on Windows XP with JRE 1.3.. if ya have ne other progam that could write the Disk Volume you can use instead.. as i used chkdsk.. no internal command i think
points as it works :-) kiddin
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Some comment.....
If not, I believe with native code invoked by Java (Using Runtime.getDefaultRuntime(