Having difficulty with the module below failing on line 21. It is telling me:
The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
Basically what it is designed to do is look for a directory, if that exists then look for a file in that directory. If both = True then it should open the folder to browse the files. I believe the issue is with the "Program Files" being 2 words since the script runs using a root path, but I'm not sure how to format the path correctly to make it work?! Ideas?
Code:Imports System.IO Module Startup Sub Main() Dim RPath As String Dim RedunOff As String RPath = "C:\Program Files\Directory\Data\Configuration" RedunOff = "C:\Program Files\Directory\Data\Configuration\Random.xml" If Directory.Exists(RPath) = True Then If File.Exists(RedunOff) = True Then Dim objShell = CreateObject("Wscript.Shell") objShell.run(RPath) End If End If End Sub End Module





Reply With Quote