Tải bản đầy đủ (.pdf) (7 trang)

AutoIT Help part 26 ppt

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (109.92 KB, 7 trang )



; Map X drive to \\myserver\stuff using current user
DriveMapAdd("X:", "\\myserver\stuff")

; Disconnect
DriveMapDel("X:")




Function Reference
DriveMapGet
Retrieves the details of a mapped drive.
DriveMapGet ( "device" )
Parameters
device The device (drive or printer) letter to query, e.g. "O:" or "LPT1:"

Return Value
Success:

Returns details of the mapping, e.g. \\server\share
Failure:

Returns a blank string "" and sets @error to 1.

Remarks
None.
Related
DriveMapAdd, DriveMapDel
Example




; Map X drive to \\myserver\stuff using current user
DriveMapAdd("X:", "\\myserver\stuff")

; Get details of the mapping
MsgBox(0, "Drive X: is mapped to", DriveMapGet("X:"))





Function Reference
DriveSetLabel
Đặt tên cho ổ đĩa
DriveSetLabel ( "path", "label" )
Parameters
path ổ đĩa
label tên mới (tối đa 11 kí tự)

Return Value
Success:

Returns 1.
Failure:

Returns 0.

Remarks
Hầu hết các ổ đĩa cứng có một nhãn chiều dài tối đa của 11 ký tự, và hàm

DriveSetLabel sẽ không thành công nếu được vượt quá chiều dài tối đa.
Also, FAT32 partition labels tend to revert to all capital letters.
Related
DriveGetDrive, DriveGetFileSystem, DriveGetLabel, DriveGetSerial,
DriveGetType, DriveSpaceFree, DriveSpaceTotal, DriveStatus
Example

DriveSetLabel("C:\", "New_Label")




Function Reference
DriveSpaceFree
trả lại dung lượng còn trống (tính = Megabytes) của ổ đĩa.
DriveSpaceFree ( "path" )
Parameters
path ổ đĩa

Return Value
Success:

trả lại số thực
Failure:

trả lại 0 và đặt @error = 1.

Remarks
DriveSpaceFree thậm chí có thể làm việc khi đường dẫn tới một thư mục (có tồn
tại). Tuy nhiên, đường dẫn tới một tập tin đường sẽ không hoạt động.

Sử dụng các hàm Round nếu giá trị trả lại quá nhiều dấu phẩy
Related
DriveGetDrive, DriveGetFileSystem, DriveGetLabel, DriveGetSerial,
DriveGetType, DriveSetLabel, DriveSpaceTotal, DriveStatus
Example

$var = DriveSpaceFree( "c:\" )
MsgBox(4096, "Free space on C:", $var & " MB")




Function Reference
DriveSpaceTotal
trả lại tổng dung lượng của ổ đĩa (tính = Megabytes).
DriveSpaceTotal ( "path" )
Parameters
path ổ đĩa

Return Value
Success:

trả lại số thực
Failure:

trả lại 0 và đặt @error = 1.

Remarks
DriveSpaceTotal thậm chí có thể làm việc khi đường dẫn tới một thư mục (có tồn
tại). Tuy nhiên, đường dẫn tới một tập tin đường sẽ không hoạt động.

Sử dụng các hàm Round nếu giá trị trả lại quá nhiều dấu phẩy
Related
DriveGetDrive, DriveGetFileSystem, DriveGetLabel, DriveGetSerial,
DriveGetType, DriveSetLabel, DriveSpaceFree, DriveStatus
Example

$var = DriveSpaceTotal( "c:\" )
MsgBox(4096, "Total Space on C:", $var & " MB")




Function Reference
DriveStatus
trả lại tình trạng của ổ đĩa
DriveStatus ( "path" )
Parameters
path ổ đĩa

Return Value
Giá trị

Sự Giải thích

UNKNOWN

Drive may be unformatted (RAW).
READY Typical of hard drives and drives that contain removable media.
NOTREADY


Typical of floppy and CD drives that do not contain media.
INVALID
May indicate the drive letter does not exist or that a mapped
network drive is inaccessible.

Remarks
Danh sách các giá trị trả lại ở trên có thể không đầy đủ.
DriveStatus thậm chí có thể làm việc khi đường dẫn tới một thư mục (có tồn tại).
Tuy nhiên, đường dẫn tới một tập tin đường sẽ không hoạt động.

Related
DriveGetDrive, DriveGetFileSystem, DriveGetLabel, DriveGetSerial,
DriveGetType, DriveSetLabel, DriveSpaceFree, DriveSpaceTotal
Example

$var = DriveStatus( "c:\" )
MsgBox(4096,"Status",$var)




Function Reference
FileChangeDir
thay đổi thư mục làm việc hiện tại
FileChangeDir ( "path" )
Parameters
path đường dẫn tới thư mục làm việc hiện tại.

Return Value
Success:


Returns 1.
Failure:

Returns 0 nếu thư mục đó ko đc thay đổi

Remarks
None.
Related
@WorkingDir
Example

FileChangeDir(@WindowsDir)




Function Reference
FileClose
đóng 1 file đã đc mở trước đó = fileopen.
FileClose ( filehandle )
Parameters
filehandle file handle (giá trị đc trả lại bởi fileopen)

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×