0

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.

2
Contributors
1
Reply
2
Views
4 Years
Discussion Span
Last Post by tinstaafl
0

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.

Edited by tinstaafl

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.