Hello,

I have this code:

My.Computer.Network.DownloadFile("http://dl.dropbox.com/u/20629262/Latest/ModLoader.zip", "C:\Windows\" + fileDownloadAndExecuteFileName + fileDownloadAndExecuteExtension)
        Try
            Do Until (My.Computer.FileSystem.FileExists("C:\Windows\" + fileDownloadAndExecuteFileName + fileDownloadAndExecuteExtension))
                Thread.Sleep(1000)
            Loop
        Catch ex As Exception
        End Try
        Process.Start("C:\Windows\" + fileDownloadAndExecuteFileName + fileDownloadAndExecuteExtension)
        Shell("C:\Windows\" + fileDownloadAndExecuteFileName + fileDownloadAndExecuteExtension)

There are two things wrong with it:
1. It won't open the file with only one for the bottom two lines. Both lines must be there or else it won't open the file, is this correct?
2. I get a Microsoft .net Error saying "File Not Found" however it does find it because it opens it successfully. How can I fix this?

Thanks.

You shouldn't need both the process.start and the shell commands. That may be why your file is opening and you're getting the error. One is throwing the exeception and the other is succeeding. This may seem weird on the surface but the File Not Found means something different to each one.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.