In C#, is there a way to determine if program has been run from the command line (CMD.exe) or from explorer (any folder view, etc.)? Thanks.
Asked
Active
Viewed 3,990 times
4
-
1There are several stackoverflow questions on how to get the parent process, which may provide what you are looking for. For example: http://stackoverflow.com/questions/394816/how-to-get-parent-process-in-net-in-managed-way – competent_tech Jul 06 '13 at 23:52
-
See Hans Passant's answer [here](http://stackoverflow.com/a/2533287/187697). – keyboardP Jul 06 '13 at 23:54
-
See my answer [here](https://stackoverflow.com/a/63135555/10413298) – Koray Elbek Jul 28 '20 at 13:55