Announcement

Collapse
No announcement yet.

Suppress error popup with Shell.Execute or File.Run?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Suppress error popup with Shell.Execute or File.Run?

    If I use Shell.Execute or File.Run and the exe does not exist, I get the following popup, followed by Application.GetLastError 1000:

    "Windows cannot find 'my.exe'. Make sure you typed the name correctly and then try again. To search for a file, click the Start button and then click Search."

    Is there a way to suppress this popup?

    Thanks.

  • #2
    Check for the existence of the file first

    Comment


    • #3
      That would mean searching the entire disk. I assume your answer means there is no way to suppress that popup?

      Comment


      • #4
        well; I didn't say that. Or mean to imply that -- I'd guess you want a windows API solution to disable windows from displaying a message.

        Moreover, if you use file.run() w/o a path. what is your expected results? Essentially you're taking a crap shoot that the correct exe would be run...

        Or you could easily parse the path and check each path that exists, along with the current (launch)folder, validate the exe is the proper one (and exists) and then run that one, or alert the user with your own message.

        Email me if you have more questions... I'm forum'd out...

        Comment

        Working...
        X