Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7944023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:26:20+00:00 2026-06-04T00:26:20+00:00

I have a hdd array with 4 encrypted hard-drives (truecrypt). I recently switched back

  • 0

I have a hdd array with 4 encrypted hard-drives (truecrypt). I recently switched back from 5 years of linux to windows 7 and I find myself confronted with a problem I can’t find a solution for.
Under linux there was a command called “fdisk” which gives you all running (not mounted!) harddrives plus a unique disk-identifier which doesn’t change (something like: Disk Identifier: 00x33f1a3c1).
I need that same functionality under Windows, preferably writing the code in java.

cheers

edit:// For clarification, I need the Disk-ID without mounting the Disk!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T00:26:21+00:00Added an answer on June 4, 2026 at 12:26 am

    A solution using VBS.

    import java.io.File;
    import java.io.FileWriter;
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    
    public class DiskUtils {
      private DiskUtils() {  }
    
      public static String getSerialNumber(String drive) {
      String result = "";
        try {
          File file = File.createTempFile("realhowto",".vbs");
          file.deleteOnExit();
          FileWriter fw = new java.io.FileWriter(file);
    
          String vbs = "Set objFSO = CreateObject(\"Scripting.FileSystemObject\")\n"
                      +"Set colDrives = objFSO.Drives\n"
                      +"Set objDrive = colDrives.item(\"" + drive + "\")\n"
                      +"Wscript.Echo objDrive.SerialNumber";  
          fw.write(vbs);
          fw.close();
          Process p = Runtime.getRuntime().exec("cscript //NoLogo " + file.getPath());
          BufferedReader input =
            new BufferedReader
              (new InputStreamReader(p.getInputStream()));
          String line;
          while ((line = input.readLine()) != null) {
             result += line;
          }
          input.close();
        }
        catch(Exception e){
            e.printStackTrace();
        }
        return result.trim();
      }
    
      public static void main(String[] args){
        String sn = DiskUtils.getSerialNumber("C");
        javax.swing.JOptionPane.showConfirmDialog((java.awt.Component)
             null, sn, "Serial Number of C:",
             javax.swing.JOptionPane.DEFAULT_OPTION);
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

have not tested on windows. but in ubuntu when u disconnect from the network,
I have loaded Web Site from HDD. Now trying attach it to process WebDev.WebServer.EXE.
I have a problem. I upload some images from HDD to the website using
Have someone tried out DeCAL in Delphi 2009? I'm thinking about upgrading from 2007,
I have an existing file in my HDD and I want rename this file.
I have a small question: For example I'm using System.IO.File.Copy() method from .NET Framework.
I have 1 cronjob that runs every 60 minutes but for some reason, recently,
I have a problem converting a File Blob comming from a Webservice to an
I have saved FilePath in DbTable in form \\IpAdress\Hdd\Folder\fileName.extension and looks like as I
We have NTFS, FAT etc for HDD. So I just want to know what

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.