📄 vbs307.htm
字号:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><HTML>
<HEAD>
<TITLE>GetDrive Method</TITLE>
<META NAME="CATEGORY" CONTENT="Language Reference">
<META NAME="MS.LOCALE" CONTENT="EN-US">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso8859-1">
<META NAME="PRODUCT" CONTENT="Visual Basic Scripting Edition">
<META NAME="TECHNOLOGY" CONTENT="SCRIPTING">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="GetDrive Method">
</HEAD>
<BODY BGCOLOR=FFFFFF LINK=#0033CC>
<!--TOOLBAR_START-->
<!--TOOLBAR_EXEMPT-->
<!--TOOLBAR_END-->
<FONT FACE="Verdana, Arial, Helvetica" SIZE=2>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR VALIGN=TOP><TD WIDTH=360>
<FONT SIZE=1 COLOR=#660033>Microsoft® Visual Basic® Scripting Edition</FONT><BR>
<FONT SIZE=5 COLOR=#660033><B>GetDrive Method</B></FONT></TD>
<TD ALIGN=RIGHT>
<FONT SIZE=2> <A HREF="vbstoc.htm">Language Reference</A> <BR>
<A HREF="vbs16.htm">Version 3</A> <P></FONT>
</TD></TR>
</TABLE>
<FONT SIZE=2><p>
<A HREF="vbs309.htm">See Also</A> <A HREF="vbs308.htm">Applies To</A></FONT>
<HR noshade SIZE=1>
<H5>Description</H5>
<BLOCKQUOTE>Returns a <b>Drive</b> object corresponding to the drive in a specified path.</BLOCKQUOTE>
<H5>Syntax</H5>
<BLOCKQUOTE><i>object</i>.<b>GetDrive</b> <i>drivespec</i>
<P>The <b>GetDrive</b> method syntax has these parts:
<P>
<TABLE WIDTH=87% BORDER=1 CELLPADDING=5 CELLSPACING=0>
<TR VALIGN=TOP BGCOLOR="#DDDDDD">
<TD><FONT SIZE=2><b>Part</b></FONT></TD>
<TD><FONT SIZE=2><b>Description</b></FONT></TD></TR>
<tr valign=top><td><font size=2><i>object</i></font></td>
<td><font size=2>Required. Always the name of a <b>FileSystemObject</b>.</font></td></tr>
<tr valign=top><td><font size=2><i>drivespec</i></font></td>
<td><font size=2>Required. The <i>drivespec</i> argument can be a drive letter (c), a drive letter with a colon appended (c:), a drive letter with a colon and path separator appended (c:\), or any network share specification (\\computer2\share1).</font></td></tr>
</TABLE></BLOCKQUOTE>
<H5>Remarks</H5>
<BLOCKQUOTE>
For network shares, a check is made to ensure that the share exists.<p>
An error occurs if <i>drivespec</i> does not conform to one of the accepted forms or does not exist.<p>
To call the <b>GetDrive</b> method on a normal path string, use the following sequence to get a string that is suitable for use as <i>drivespec</i>:
<BLOCKQUOTE><PRE><FONT FACE="Courier New" SIZE=3>DriveSpec = GetDriveName(GetAbsolutePathName(Path))
</FONT></PRE></BLOCKQUOTE>
</BLOCKQUOTE>
<hr noshade size=1>
<FONT SIZE=2>
<p align=center><em><a href="../../common/colegal.htm">© 1997 by Microsoft Corporation. All rights reserved.</a></em></p>
</FONT></FONT></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -