Vbscript IfExist说谎并返回不正确的值

Vbscript IfExist说谎并返回不正确的值,vbscript,Vbscript,如果(fso.FileExists(fso.GetAbsolutePathName(“”&“\prefs.txt”)=True),则在我的VBScript表单中,,然后我让它在消息框中显示路径,并转到路径进行确认,但我指定的文件不存在,并且该语句证明为True。我做错什么了吗?虽然可以想象您的VBScript安装或文件系统已损坏,但问题更可能的原因可能是 隐藏2隐藏文件。属性为读/写 文件上的属性: >> WScript.Echo "exists", CStr(goFS.FileEx

如果(fso.FileExists(fso.GetAbsolutePathName(“”&“\prefs.txt”)=True),则在我的VBScript表单中,
,然后我让它在消息框中显示路径,并转到路径进行确认,但我指定的文件不存在,并且该语句证明为True。我做错什么了吗?

虽然可以想象您的VBScript安装或文件系统已损坏,但问题更可能的原因可能是

隐藏2隐藏文件。属性为读/写

文件上的属性:

>> WScript.Echo "exists", CStr(goFS.FileExists(".\chmdump.txt"))
>> WScript.Echo goFS.GetFile(".\chmdump.txt").Attributes
>> WScript.Echo goFS.GetFile(".\chmdump.txt").Attributes And 2
>>
exists True
34
2
FSO会找到该文件,但根据设置,文件浏览器不会:

dir chmdump.txt
...
File Not Found

attrib chmdump.txt
A   H      C:\Documents and Settings\eh\chmdump.txt

attrib -H chmdump.txt

dir chmdump.txt
..
13.10.2008  08:48            12.947 chmdump.txt

如果将
sTmp=fso.GetAbsolutePathName(“”&“\prefs.txt”
wscript.echo“sTmp:&sTmp
放入,那么
wscript.echo”文件存在:“&fso.FileExists(sTmp)