Why do I get file not found excpetion with Interaction.Shell method?
-
29-10-2019 - |
Question
I want to open a notepad file using VisualBasic.Interaction.Shell
method. At present I get a file not found exception using the following code.
int pid = Interaction.Shell(@"D:\abc.txt", AppWinStyle.NormalNoFocus, false, -1);
But this works:
int pid = Interaction.Shell(@"notepad.exe", AppWinStyle.NormalNoFocus, false, -1);
Which just opens a notepad file. Why is this?
I do need it to open a file in a specific location. I see some advantage with Interaction.Shell execution. How is it possible to open a file in a specific location using Interaction.Shell?
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow