Hi, I'm using my Leonardo as an HID (keyboard) device. I am trying to find out how to write a sketch or script so that when the Leo is plugged it check for a file name (I.E. /desktop/random_file_name.txt ) And if it finds that file then it launches the Arduino IDE and if the file is not present then it launches my keyboard command script. I would like to do this outside of CMD or powershell if possible, otherwise if not possible I would need help in figuring out how to code this to happen. I imagine an if statement is involved here but I am novice at best when it comes to code and do not know windows scripting at all.
The principal behind this is when the Leo is placed in it's "home" PC it will check for random_file_name.txt and if it finds it, then it will not execute the preprogrammed keystrokes however if it does not find the file it will execute the preprogrammed key strokes. Launching the Arduino IDE is optional, but added it above just to convey that I'm aiming at the Leo going into a pseudo programming mode when plugged up to it's home PC.
I would greatly appreciate any assistance. Thanks in advanced!