mark2004 Posted January 2, 2009 Share Posted January 2, 2009 Hi all. I would like to have a program launch automatically when my camera is connected to the computer via usb. The camera shows up as the F Drive. Is there a way to make a program launch automatically when the camera drive is detected?? I don't know where to start on this one. Thanks. Link to comment Share on other sites More sharing options...
Varian Posted January 2, 2009 Share Posted January 2, 2009 This is a start: While 1 If FileExists('F:\*') Then _LaunchProgram() Sleep(100) WEnd Func _LaunchProgram() Run('Program.exe') ProcessWaitClose('Program.exe') While FileExists('F:\*') Sleep(100) Wend EndFunc Link to comment Share on other sites More sharing options...
mark2004 Posted January 2, 2009 Author Share Posted January 2, 2009 O.K. I guess you have to create a program that is running constantly to accomplish this. That seems obvious now that I think about it. Thanks for pointing me in the right direction. This is a start: While 1 If FileExists('F:\*') Then _LaunchProgram() Sleep(100) WEnd Func _LaunchProgram() Run('Program.exe') ProcessWaitClose('Program.exe') While FileExists('F:\*') Sleep(100) Wend EndFunc Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now