People usually trigger programs already there on their PCs when they connect their uC. There are already things like uC that can inject keystrokes. I was thinking of something even more ambitious -
I write a program in C or Python that i want to run in the background and somehow(?) store it in the flash of the uC. As soon as the uC is plugged in, lets say it shows itself as a USB Keyboard or something similar and dumps the contents of the flash to the PC and runs that program in the background of the PC.
Is this possible? If yes, I would like to have some suggestions on how to go about accomplishing it.