快捷搜索:

也许是好东西——Windows Script Host-3[获取硬盘分区

'奸淫奸淫奸淫奸淫奸淫奸淫奸淫奸淫奸淫奸淫奸淫奸淫奸淫奸淫奸淫奸淫

' File:GetDriveX.vbs (WSH sample in VBScript)

' Author:(c) G. Born

'

' Showing the properties of a drive by using

' FileSystemObject

'奸淫奸淫奸淫奸淫奸淫奸淫奸淫奸淫奸淫奸淫奸淫奸淫奸淫奸淫奸淫奸淫

Option Explicit

' Drive type constants

Const Unknown = 0

Const Removable = 1' Removable medium

Const Fixed = 2' Fixed medium (hard disk)

Const Remote = 3' Network drive

Const CDROM = 4' CD-ROM

Const RAMDisk = 5' RAM disk

Dim Text, Title, drive

Dim fso, oDrive' Object variable

Dim drtype(6)

drtype(0) = " Unknown "

drtype(1) = " Removable "

drtype(2) = " Fixed "

drtype(3) = " Remote "

drtype(4) = " CDROM "

drtype(5) = " RAMDisk "

Text = "Drive" & vbCrLf & vbCrLf

Title = "WSH sample - by G. Born"

drive = ""

Do' Query drive letter.

drive = InputBox("Drive letter (e.g. A)", "Drive", "C")

If drive = "" Then' Test for Cancel button.

WScript.Quit

End If

drive = Left(drive, 1)' Extract drive letter.

' Valid drive name (between A and Z)?

If Asc(UCase(drive))Asc("Z") Then

MsgBox "Drive " & drive & " is illegal"

drive = ""

End If

Loop Until drive

您可能还会对下面的文章感兴趣: