Thinkster Posted February 16, 2009 Share Posted February 16, 2009 OK, so what I want to do is prevent people from having the choice to RIP a CD when Autoplay pops up after inserting a CD. The Branch is located at:[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival]And the keys I want to get rid of are:MSRipCDAudioOnArrivalNeroAutoPlay2RipCDNeroAutoPlay2AudioToNeroDigitalAnd then within the Branch:[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers]I want to get rid of the corresponding "subbranches" and the keys withinEX: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\MSRipCDAudioOnArrival\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\NeroAutoPlay2RipCDand of course I want to get rid of Any/All iTunes keys as well.Is there a simple way i can accomplish this with command line scripting (batch script)? Link to comment Share on other sites More sharing options...
nomadturk Posted February 16, 2009 Share Posted February 16, 2009 Thank god i've removed autoplay from my system. See what people are trying to do? Mess up with my system? Hell no! Link to comment Share on other sites More sharing options...
radix Posted February 16, 2009 Share Posted February 16, 2009 REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\MSRipCDAudioOnArrival\" /fREG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\NeroAutoPlay2RipCD" /f Link to comment Share on other sites More sharing options...
Thinkster Posted February 21, 2009 Author Share Posted February 21, 2009 Thanks, I worte the script and got it to work with a little tweaking. I had to use the /v ValueName for some of them like below: REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" /v NeroAutoPlay2RipCD /fNow the other tricky thing, Is there a way to silently run a script on startup that will check for the presence of a particular key or keys and if present, delete them?This is so if the user installs iTunes, certain reg keys will be present and only if those are present, will be deleted.Like this key for example: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\iTunesImportSongsOnArrival Link to comment Share on other sites More sharing options...
Thinkster Posted February 21, 2009 Author Share Posted February 21, 2009 OK, I think I figured it out unless someone knows a better way. The only thing I'm concerned about is the use of CMDOW because the Antivirus programs usually kill this file and then the script won't run correctly. But here's the rough:cmdow @ /HID@ECHO OFFping -n 2 localhost> NULREG QUERY "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" /v iTunesImportSongsOnArrivalif "%errorlevel%" GTR "0" (goto fail) ELSE goto pass1:failecho Key not foundexit:pass1echo 1st Key is presentping -n 2 localhost> NULREG QUERY "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" /v iTunesPlaySongsOnArrivalif "%errorlevel%" GTR "0" (goto fail) ELSE goto pass2:pass2echo 2nd Key is presentping -n 2 localhost> NULREG QUERY "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" /v iTunesShowSongsOnArrivalif "%errorlevel%" GTR "0" (goto fail) ELSE goto pass3:pass3echo 3rd Key is presentping -n 2 localhost> NULREG QUERY "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" /v iTunesBurnCDOnArrivalif "%errorlevel%" GTR "0" (goto fail) ELSE goto pass4:pass4ping -n 2 localhost> NULEcho Machine tests positive for iTunesEcho Now Going to kill the keys!REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\iTunesBurnCDOnArrival" /fREG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\iTunesImportSongsOnArrival" /fREG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\iTunesPlaySongsOnArrival" /fREG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\iTunesShowSongsOnArrival" /fREG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" /v iTunesShowSongsOnArrival /fREG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" /v iTunesPlaySongsOnArrival /fREG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" /v iTunesImportSongsOnArrival /fREG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" /v iTunesBurnCDOnArrival /fEcho Completed!ping -n 4 localhost> NULEXIT 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