DriveGet

컴퓨터 드라이브에 관하여 다양한 유형의 정보를 열람합니다.

DriveGet, OutputVar, SubCommand , Value

The OutputVar parameter is the name of the output variable in which to store the result. SubCommandValue 매개변수는 서로 의존합니다. 그 사용법은 아래에 기술합니다.

부-명령어

For SubCommand, specify one of the following:

List

Retrieves a string of letters, one character for each drive letter in the system.

DriveGet, OutputVar, List , Type

Result example: ACDEZ. 만약 Type이 생략되면, 모든 드라이브 유형이 열람됩니다. 그렇지 않으면, Type이 반드시 다음 중 하나를 지정해야 오직 그 특정한 드라이브만 열람할 수 있습니다: CDROM, REMOVABLE, FIXED, NETWORK, RAMDISK, UNKNOWN.

Capacity (or Cap)

Retrieves the total capacity of a drive which contains the specified path, in megabytes.

DriveGet, OutputVar, Capacity, Path

Path is any path contained by the drive (might also work on UNC paths and mapped drives). The result is rounded down to the nearest whole number. Use DriveSpaceFree to determine the free space.

FileSystem (or FS)

Retrieves the type of the specified drive's file system.

DriveGet, OutputVar, FileSystem, Drive

Drive는 드라이브 기호 다음에 쌍점과 선택적으로 역사선이 따라옵니다, 또는 \\server1\share1과 같은 UNC 이름입니다. The possible values for OutputVar are defined by the system; they include (but are not limited to) the following: NTFS, FAT32, FAT, CDFS (typically indicates a CD), or UDF (typically indicates a DVD). 드라이브에 포맷된 미디어가 들어 있지 않으면 OutputVar는 비워지고 ErrorLevel은 1이 설정됩니다.

Label

Retrieves the volume label of the specified drive.

DriveGet, OutputVar, Label, Drive

Drive는 드라이브 기호 다음에 쌍점과 선택적으로 역사선이 따라옵니다, 또는 \\server1\share1과 같은 UNC 이름입니다.

To change the label, use the Drive's Label sub-command, such as Drive, Label, C:, MyLabel.

Serial

Retrieves the volume serial number of the specified drive.

DriveGet, OutputVar, Serial, Drive

Drive는 드라이브 기호 다음에 쌍점과 선택적으로 역사선이 따라옵니다, 또는 \\server1\share1과 같은 UNC 이름입니다. See Format() or SetFormat for how to convert the result to hexadecimal.

Type

Retrieves the type of the drive which contains the specified path.

DriveGet, OutputVar, Type, Path

Path is any path contained by the drive (might also work on UNC paths and mapped drives). OutputVar is made blank if the path is invalid (for example, because the drive does not exist). Otherwise, it is set to one of the following words: Unknown, Removable, Fixed, Network, CDROM, RAMDisk.

Status

Retrieves the status of the drive which contains the specified path.

DriveGet, OutputVar, Status, Path

Path is any path contained by the drive (might also work on UNC paths and mapped drives). OutputVar is set to one of the following words:

Status 주의
Unknown Might indicate unformatted/RAW file system.
Ready This is the most common.
NotReady Typical for removable drives that don't contain media.
Invalid Path does not exist or is a network drive that is presently inaccessible, etc.

StatusCD

Retrieves the media status of a CD or DVD drive.

DriveGet, OutputVar, StatusCD , Drive

Drive는 드라이브 기호 다음에 쌍점. Drive 생략되면, 기본 값은 CD/DVD 드라이브가 사용됩니다. 상태를 알아낼 수 없으면 OutputVar는 비워집니다. 그렇지 않으면 다음 문자열 중 하나가 설정됩니다:

Status 의미
not ready 드라이브에 접근할 준비가 되지 않았습니다. 아마도 쓰기 작업 중일 수 있습니다. 알려진 한계: "not ready"는 또한 드라이브에 CD가 아니라 DVD가 들어 있는 경우에도 일어납니다.
open 드라이브에 디스크가 없거나, 트레이가 사출되어 있습니다.
playing 드라이브가 디스크를 연주 중입니다.
paused 이전에 연주 중이던 오디오 또는 비디오가 현재 정지되어 있습니다.
seeking 드라이브를 탐색 중입니다.
stopped 드라이브에 CD가 들어 있지만 현재 접근하지 못합니다.

이 부-명령어는 아마도 네트워크 드라이브나 비-CD/DVD 드라이브에서는 작동하지 않을 것입니다; 그런 경우 또는 다른 어떤 이유로 실패하면, OutputVar는 비워지고 ErrorLevel은 1이 설정됩니다.

트레이가 최근에 닫혔다면, 부-명령어가 완료하려면 좀 시간이 걸릴 수 있습니다.

To eject or retract the tray, see the Drive's Eject sub-command.

에러 처리

[v1.1.04+]: 이 명령어는 실패하면 예외를 던질 수 있습니다. 더 자세한 정보는 실행시간 에러를 참조하십시오.

ErrorLevel은 문제가 있으면 1, 그렇지 않으면 0이 설정됩니다.

논평

Some of the sub-commands will accept a network share name as Path or Drive, such as \\MyServer\MyShare\.

Drive, DriveSpaceFree

예제

Allows the user to select a drive in order to analyze it.

FileSelectFolder, folder,, 3, 분석할 드라이브를 고르십시오:
if not folder
    return
DriveGet, list, List
DriveGet, cap, Capacity, %folder%
DriveSpaceFree, free, %folder%
DriveGet, fs, FileSystem, %folder%
DriveGet, label, Label, %folder%
DriveGet, serial, Serial, %folder%
DriveGet, type, Type, %folder%
DriveGet, status, Status, %folder%
MsgBox All Drives: %list%`nSelected Drive: %folder%`nDrive Type: %type%`nStatus: %status%`nCapacity: %cap% M`nFree Space: %free% M`nFilesystem: %fs%`nVolume Label: %label%`nSerial Number: %serial%