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 6844823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:25:31+00:00 2026-05-27T00:25:31+00:00

Possible Duplicate: How to get system info in PHP? I am building a simple

  • 0

Possible Duplicate:
How to get system info in PHP?

I am building a simple file browser, I want to know as how to get the system information like the total drives and there names through php script?

thanks

  • 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-05-27T00:25:32+00:00Added an answer on May 27, 2026 at 12:25 am

    This is gotten from the manual, and is for windows (Since you didn’t specify the OS.) using the COM class.

    Note : This has nothing to do with the client side.

    <?php
     $fso = new COM('Scripting.FileSystemObject'); 
        $D = $fso->Drives; 
        $type = array("Unknown","Removable","Fixed","Network","CD-ROM","RAM Disk"); 
        foreach($D as $d ){ 
           $dO = $fso->GetDrive($d); 
           $s = ""; 
           if($dO->DriveType == 3){ 
               $n = $dO->Sharename; 
           }else if($dO->IsReady){ 
               $n = $dO->VolumeName; 
               $s = file_size($dO->FreeSpace) . " free of: " . file_size($dO->TotalSize); 
           }else{ 
               $n = "[Drive not ready]"; 
           } 
       echo "Drive " . $dO->DriveLetter . ": - " . $type[$dO->DriveType] . " - " . $n . " - " . $s . "<br>"; 
    
        } 
    
          function file_size($size) 
          { 
          $filesizename = array(" Bytes", " KB", " MB", " GB", " TB", " PB", " EB", " ZB", " YB"); 
          return $size ? round($size/pow(1024, ($i = floor(log($size, 1024)))), 2) . $filesizename[$i] : '0 Bytes'; 
          } 
    
    
    ?> 
    

    Would output something similar to

    Drive C: - Fixed - Bla - 88.38 GB free of: 444.14 GB
    Drive D: - Fixed - Blas - 3.11 GB free of: 21.33 GB
    Drive E: - Fixed - HP_TOOLS - 90.1 MB free of: 99.02 MB
    Drive F: - CD-ROM - [Drive not ready] - 
    Drive G: - CD-ROM - Usb - 0 Bytes free of: 24.75 MB
    Drive H: - Removable - [Drive not ready] - 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: .NET file system wrapper library I would like to write a test
Possible Duplicate: iPhone Mobile Safari File System Access I want to open a locally
Possible Duplicate: including php file from another server with php i want to have
Possible Duplicate: PHP detecting request type (GET, POST, PUT or DELETE) This should be
Possible Duplicate: PHP ToString() equivalent I get this error: Catchable fatal error: Object of
Possible Duplicate: Return value from thread I want to get the free memory of
Possible Duplicate: Get all possible word combinations I want to get a power list
Possible Duplicate: Reliable method to get machine's MAC address in C# I want to
Possible Duplicate: How to get the OS on which PHP is running? I need
Possible Duplicate: C# - How do you get total amount of RAM the computer

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.