[求助]shell判断文件存在的问题
Shell "explorer c:\1.txt" '如果不存在的话,系统会给出提示框。我的问题就是:是不是可以似的这个提示框不弹出呢?
这样我只要在shell语句后加上 on error goto a
就可以实现对文件是否存在的判断了
这个思路对吗?
谢谢
首先 dir下,如果 文件为空就不打开!
dim lsFileName as string
lsFileName =dir("c:\1.txt")
if lsFIleName="" then
msgbox "文件不存在"
else
shell("notepad.exe c:\1.txt")
end if