为什么GetAName2
在以下功能中起作用,但不是GetAName
?
Function isWimPathLocal(wimfilepath)
if blnDEBUG Then WSCript.Echo vbCrLf & "Inside... isWimPathLocal()"
'Dim filespec: filespec = wimfilepath
Dim filespec: filespec = "Z:\install_files\7\32-bit\sources\install.wim\XXX"
Dim GetAName: GetAName = objFSO.GetDriveName(wimfilepath)
if blnDEBUG Then WSCript.Echo "filespec: " & filespec
if blnDEBUG Then WSCript.Echo "wimfilepath: " & wimfilepath
if blnDEBUG Then WSCript.Echo "GetAName: " & GetAName
dim fso:set fso = CreateObject("Scripting.FileSystemObject")
Dim GetAName2: GetAName2 = objFSO.GetDriveName(filespec)
WScript.Echo "GetAName2: " & GetAName2
'if blnDEBUG Then WSCript.Echo "wimfilepath: " & wimfilepath
'strWimDrv = objFSO.GetDriveName(wimfilepath)
'if blnDEBUG Then WSCript.Echo "strWimDrv: " & strWimDrv
'intDriveType = GetDriveType(strWimDrv)
'If intDriveType = 2 Then
' isWimPathLocal = TRUE
'Else
' isWimPathLocal = FALSE
'End if
if blnDEBUG Then
WScript.Echo "Break... isWimPathLocal()"
WScript.Quit
End if
End Function
上述函数的输出为:
Inside... isWimPathLocal()
filespec: Z:\install_files\7\32-bit\sources\install.wim\XXX
wimfilepath: "Z:\install_files\7\32-bit\sources\install.wim"
GetAName:
GetAName2: Z:
Break... isWimPathLocal()