这可用下列语句进行判断
Dir([pathname],[Attributes as VbFileAttribute=vbNormal]) As String
解释: pathname:文件的绝对路径;
Attributes:文件的属性。
“[]”内为可选项。dir(file)=""表示文件不存在,dir(file)<>""表示文件存在。
例如判断c:wpswinwps.exe是否存在,如存在,就调用它,可用下列语句:
if dir("c:wpswinwps.exe")<>"" then
shell "c:wpswinwps.exe"
end if