Problems with Notepad when calling from VB.net

Janne Lindh 46 Reputation points
2022-06-05T09:05:00.537+00:00

The problem has occurred after switching to Windows 11 from 10. It is probably a bug that MS can fix but, in that case, I do not know which way the error should be reported. I therefore first turn to the forum in the hope that someone here is aware of the problem.

Receives no error code other than in the Logbook.

The same problem arises regardless of whether I call VB.net directly or run Visual Studio (VS) 2019

I have updated the operating system and VS

Opening a file directly with Notepad works well. But if I use a VB.net program which in turn runs notepad.exe it does not work, i.e., the file does not open.

If I right-click on the Notepad button, the requested file is in that list. If I then select the file in the list, the file opens as it should.

See attached images

Sincerely
Janne

208501-msc20220605.png
208429-msc20220605-2.png
208492-msc20220605-3.png

Developer technologies | Universal Windows Platform (UWP)
Developer technologies | .NET | .NET Runtime
0 comments No comments
{count} votes

Answer accepted by question author
  1. Viorel 125.7K Reputation points
    2022-06-05T09:32:26.143+00:00

    Try the alternatives:

    Process.Start("notepad.exe", wFilePathName)

    or

    Shell("notepad.exe """ & wFilePathName & """", Style:=AppWinStyle.NormalFocus)

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.