为什么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()
答案 0 :(得分:1)
字符串“wimfilepath”似乎包含它的周围引号。该字符串不应该像filespec一样无引号吗?