我正在尝试检查文件是否存在/链接是否存在,如下所示:没有成功
这是我的代码:
filespec = "C:\Users\xyz\AppData\Roaming\Microsoft\Windows\Start Menu\Programs"&"\Internet Explorer.lnk"
filespec1 = char(34)&"C:\Users\xyz\AppData\Roaming\Microsoft\Windows\Start Menu\Programs"&"\Internet Explorer.lnk" &char(34)
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FileExists(filespec)) Then
msg = filespec & " exists."
Else
msg = filespec & " doesn't exist."
End If
WScript.Echo(msg)
If (fso.FileExists(filespec1)) Then
msg = filespec1 & " exists."
Else
msg = filespec1 & " doesn't exist."
End If
WScript.Echo(msg)
以上都不起作用?任何建议都受到高度赞赏。
亲切的问候,赞恩