Use ASP to list all hard disks and types on the server
Source: Internet
Author: User
List all disks of the server.
<%
Function Tran (drv)
Select case drv
Case 0: Tran = "unable to recognize devices"
Case 1: Tran = "floppy disk drive"
Case 2: Tran = "hard drive"
Case 3: Tran = "Network Hard Drive"
Case 4: Tran = "disc drive"
Case 5: Tran = "RAM virtual drive"
End select
End function
Set fs = Server. CreateObject ("Scripting. FileSystemObject ")
Response. write "<table width = '000000' cellpadding = '5' cellspacing = '2'> <tr> <td> <B> drive letter </td> <B> drive type
</Td> </tr>"
For each d in fs. drives
Response. write "<tr> <td> <a href = files. asp? SPath = "& d. DriveLetter &":> <font size = 4> <B> "&
D. DriveLetter & "</a> </td> <font size = 4> <B>" & Tran (d. DriveType) & "</tr>"
Next
Set fs = nothing
Response. write "</table>"
%>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service