- Dim fso, wsh, ProcEnv, msg, filepath
- Set fso = CreateObject("Scripting.FileSystemObject")
- Set wsh = WScript.CreateObject("WScript.Shell")
- Set ProcEnv = wsh.Environment("PROCESS")
-
- filepath = ProcEnv("SYSTEMROOT") & "\temp\your_file"
-
- If (fso.FileExists(filepath)) Then
- msg = filepath & " 存在。"
- Else
- msg = filepath & " 不存在。"
- End If
- msgbox msg
复制代码
|