【发布时间】:2014-05-29 03:39:47
【问题描述】:
我正在尝试检查我的 PC 是否在目录中确实有例如 Outlook.exe(它确实有),但是在运行代码 FileExists 时会自动返回 false,这会导致我显示该文件不存在的消息。你能帮帮我吗?
Set fso = CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject( "WScript.Shell" )
outlook15 = "%ProgramFiles(x86)%\Microsoft Office\Office15\outlook.exe"
If (fso.FileExists("%ProgramFiles(x86)%\Microsoft Office\Office15\OUTLOOK.exe")) Then
msgbox outlook15 & " exists."
Else
msgbox outlook15 & "doesn't exists."
End If
【问题讨论】:
标签: vbscript