Strange behaviour in Windows 10

The problem is that the IDE doesn't have any support for passing a sketch path via the command line argument, which is what Windows does when you click on a file that is associated with an application. So there is no difference in the behavior between clicking on a sketch in Windows Explorer and just starting the IDE application itself. This deficiency is being tracked here:

There was some work on it here:

I would be interested to hear more about those.

It sounds like this bug:

Does that match with what you are experiencing?

Before submitting a report, please do two things:

  1. Download the nightly build and check whether the issue still occurs there, or if it has been fixed by the developers already:
    https://github.com/arduino/arduino-ide#nightly-builds
  2. Search the existing issues to see whether it was already reported:
    https://github.com/arduino/arduino-ide/issues?q=

After that, you can submit bug reports and feature requests here:
https://github.com/arduino/arduino-ide/issues/new/choose
Thanks!