saywell Posted December 9, 2011 Share Posted December 9, 2011 Hi, I'm updating my program for loading photos onto my PC [from memory card]. I'd like to have an option in the windoze 'autoplay' context so that when I insert the card, there's an option to run my app from the po-up context menu. I've searched forums for 'autoplay' - amazingly only 4 hits, none relevant. Any suggestions as to how to do this? I presume it will need some registry keys added/altered when the app first runs. Regards, William Link to comment Share on other sites More sharing options...
Mikeman27294 Posted December 9, 2011 Share Posted December 9, 2011 Yes - this has nothing to do with autoIT, rather the autorun.inf file.http://msdn.microsoft.com/en-us/library/windows/desktop/cc144200(v=vs.85).aspxTake a look there, it has everything you need to know about the autorun file. Link to comment Share on other sites More sharing options...
saywell Posted December 9, 2011 Author Share Posted December 9, 2011 Thanks Mikeman. I know it's not really autoit, but there's so much knowledge here...I'd looked at autorun.inf and use it for a CD program I've written - but most memory cards don't have one, and I wouldn't want to have to install one on every card I might use.Some programs, eg Picasa, add themselves to the autoplay context menu when they're installed, so that they become an option if any card is inserted. That's what I'm after.Regards,William Link to comment Share on other sites More sharing options...
Mikeman27294 Posted December 9, 2011 Share Posted December 9, 2011 Just use a filewrite to do it. Or you could set the autorun.inf file to be read only and package it with your progam (assuming thats what you are doing). Link to comment Share on other sites More sharing options...
gmoyle Posted February 15, 2012 Share Posted February 15, 2012 I think I hit on what William was looking to do here. Lets say you insert a movie disc or music CD and you want your program to trigger off that. You need to enter some registry information. Being a noob here myself I simply used Autoplay Repair to create the functionality I needed, then searched the registry and exported it all to a file that I could use to merge on installs of my apps. Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOTDVD] [HKEY_CLASSES_ROOTDVDshell] [HKEY_CLASSES_ROOTDVDshellMyAutoItApp] @="AutoRip" [HKEY_CLASSES_ROOTDVDshellMyAutoItAppcommand] @="C:Program Files (x86)MyAutoItAppMyAutoItApp.exe "%L"" [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersHandlersMyAutoItApp] "Action"="My Apps Function" "DefaultIcon"="C:Program Files (x86)MyAutoItAppMyAutoItApp.exe,0" "InvokeProgID"="DVD" "InvokeVerb"="MyAutoItApp" "Provider"="MyAutoItApp" [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerAutoplayHandlersEventHandlersPlayDVDMovieOnArrival] "MyAutoItApp"="" This results in an option when a DVD is inserted to "My Apps Function using MyAutoItApp" In the registry under the AutoPlayHandlers there are many different EventHandlers you could use. 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